WebTools

307 Useful Tools & Utilities to make life easier.

HTTP Headers Parser

Parse HTTP Headers for any URL.

Understanding the HTTP Headers Parser

The HTTP Headers Parser is a robust developer utility designed to execute server-side requests and extract the raw HTTP response headers returned by a target URL. For web developers, system administrators, and SEO professionals, analyzing HTTP headers is critical for debugging caching policies (like Cache-Control and Expires), verifying security implementations (such as Strict-Transport-Security or Content-Security-Policy), and identifying server software configurations.

Because the request is executed from the tool's server rather than your local browser, it provides a clean, unbiased view of the headers returned to a generic client, completely bypassing local browser caching, extensions, or local DNS overrides.

Core Mechanics and Validation

Built on the Laravel framework and powered by Livewire for reactive, page-reload-free interactions, the tool operates seamlessly. When a user submits a URL, the backend component intercepts the input and performs sanitization and validation.

First, it checks the protocol. If the provided URL lacks a protocol, the system uses Laravel's Str::startsWith to automatically prepend https://. After normalization, the URL is strictly validated using PHP's native filter_var($url, FILTER_VALIDATE_URL). If the input format is malformed, execution halts immediately, and a localized error message is dispatched to the frontend.

Deep Dive: cURL Configuration and Behavior

Under the hood, the tool bypasses Laravel's standard HTTP facade in favor of a raw cURL implementation. This allows for fine-grained control over the request lifecycle. The tool utilizes the following specific configurations:

  • Aggressive Redirect Following: The tool sets CURLOPT_FOLLOWLOCATION to true and configures CURLOPT_MAXREDIRS to 20. This means if the target URL sits behind a long chain of redirects (e.g., HTTP to HTTPS, then naked domain to WWW, then to a specific path), the tool will automatically traverse up to 20 hops to reach the final destination.
  • Strict Timeouts: To prevent hanging processes when querying unresponsive servers, a strict 30-second timeout is enforced via CURLOPT_TIMEOUT. If the target server fails to return the headers within this window, a cURL exception is caught and displayed.
  • Disabled SSL Verification: Crucially, the tool forces CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to false. This deliberate choice makes the parser incredibly useful for debugging staging environments, internal IP addresses, or broken servers that have expired, self-signed, or misconfigured SSL certificates.

How Headers are Extracted and Rendered

Instead of waiting for the request to complete and parsing a bulk string, the tool uses CURLOPT_HEADERFUNCTION. This callback fires in real-time for every single header line received during the request. All captured headers—including headers from intermediate redirects—are pushed into a state array.

On the presentation side, the Livewire Blade template iterates through this array. Interestingly, the frontend implements a specific filter: !str_starts_with($header, 'HTTP/'). This logic intentionally strips out the primary HTTP status lines (such as HTTP/1.1 200 OK or HTTP/2 301 Moved Permanently), leaving behind only the pure key-value header pairs. Furthermore, any empty lines are trimmed and discarded, resulting in a clean, monospaced list of headers.

Worked Example

Let’s look at a concrete example of how the tool processes a request.

Input: example.com

Step-by-step Execution:

  1. The backend detects the missing protocol and normalizes the input to https://example.com.
  2. The cURL request is dispatched. The server responds with headers.
  3. The HEADERFUNCTION callback captures the raw lines, including the status line.
  4. The frontend receives the array and iterates over it. It detects the HTTP/2 200 line and hides it based on the str_starts_with filter.

Expected Output Displayed:

Accept-Ranges: bytes
Age: 530491
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Thu, 20 Aug 2026 22:28:00 GMT
Server: ECS (sec/976D)

Frequently Asked Questions

Will this tool work on websites with expired or invalid SSL certificates?

Yes. The backend cURL configuration explicitly disables both peer and host SSL verification. This ensures the request will not fail due to a certificate error, allowing you to successfully inspect the headers of improperly secured endpoints or staging servers.

How many redirects can the parser handle?

The parser is configured to follow up to 20 redirects automatically (CURLOPT_MAXREDIRS). It will collect the headers across the redirect chain. If the destination traps the request in an infinite redirect loop, the tool will abort after hitting the 20-redirect limit and output a cURL error.

Why don't I see the HTTP status code (e.g., 200 OK) in the output?

The tool's frontend rendering engine is designed to focus exclusively on HTTP header key-value pairs. It actively filters out any lines beginning with "HTTP/" before rendering the results to the screen, which hides the initial status code declarations.

What happens if the target server is extremely slow?

The tool enforces a strict 30-second execution timeout limit. If the target server does not complete the connection and send its headers within 30 seconds, the underlying cURL process will terminate and surface a timeout error message on the page.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us