Skip to content
alien@bugs:~tty01
Abdallah Mekky

TRACE

HTTP basics

Use these notes to understand web traffic from a local app or an explicitly authorized lab. Examples use localhost only.

All traces

Request and response

PartPurpose
MethodThe requested operation, such as GET or POST.
PathThe resource path on the selected host.
HeadersMetadata about the request or response.
StatusA three-digit result code returned by the server.
BodyOptional content sent by the client or server.
curl -I http://127.0.0.1:3000curl -sS -D headers.txt -o body.txt http://127.0.0.1:3000

Security headers

HeaderPurpose
Content-Security-PolicyRestricts the sources and capabilities a page may use.
Strict-Transport-SecurityAsks browsers to use HTTPS for a host after a secure connection.
X-Content-Type-OptionsHelps prevent browsers from interpreting a response as a different media type.
Referrer-PolicyControls how much referrer information is sent with requests.
Permissions-PolicyControls access to selected browser features.

Choose policies for the application’s actual needs and test for compatibility. A header’s presence alone does not prove an application is secure.

Cookies and sessions

AttributeWhy it matters
SecureRestricts a cookie to secure transport.
HttpOnlyPrevents ordinary client-side scripts from reading the cookie.
SameSiteLimits when a browser attaches a cookie to cross-site requests.
Path / DomainLimits the hosts and URL paths for which a cookie is sent.

More traces

Questions

What does an HTTP status code tell me?

It gives a broad result category for a request, such as success, redirection, client error or server error. The response body and application behavior provide additional context.

Why use localhost in the examples?

The examples are intentionally limited to a local service so they can be practised without sending test traffic to someone else’s system.