Repository navigation
Route requests carrying DNT and GPC headers - #47
Merged
Merged
Conversation
Firefox sends DNT: 1 on every request. DNT is not in ALWAYS_CLEAN_HEADERS, so any request carrying it fails the CORS-simple classification in is_simple_cors_request, matches no routing rule, and returns a 500 to the client. Every Firefox page navigation through the proxy hits this. Real Chrome does not send DNT, so stripping it also matches the stealth intent of the clean-headers list.
m4dni5
marked this pull request as ready for review
September 9, 2026 23:40
Owner
|
Easy enough, also added another potential header that might cause problems in Firefox. In a future edit I think this might make sense to pull out into a configurable env var... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requests carrying
DNTorSec-GPCcan fail with HTTP 500 before reaching Chrome because the router treats these browser-controlled privacy headers as author-supplied CORS headers. This affects navigation, ordinary form submissions, and page resources.Ignore both header names, case-insensitively, only for routing classification. Keep them separate from
ALWAYS_CLEAN_HEADERSso the fix does not introduce an outgoing privacy-header stripping policy. Application headers, methods, and content types still undergo the existing checks. Chrome continues to control its own outgoing privacy signals; this does not promise to forward the caller's DNT/GPC preference to the destination.This also corrects the original description: DNT is not sent by every Firefox request, and Chrome can send DNT when its setting is enabled. Firefox removed the DNT setting in version 135 and supports GPC instead. Fresh local Firefox 140.14.0 ESR profiles confirmed no DNT by default and
Sec-GPC: 1when GPC was enabled.Validation used existing container images with Chrome 142.0.7444.175 and current main plus this patch. Forty local HTTP requests through the host proxy port exercised before/after navigation, form, resource, fetch, mixed-case names,
DNT: 0, combined headers, header-only requests, JSON bodies, and controls for unrelated headers/content types. Successful responses had exact body bytes and correct lengths; form and JSON payloads reached the origin intact. Two cases enabled Chrome's own DNT setting and confirmed it still sentDNT: 1, even with inboundDNT: 0. Fresh profiles, certificates, containers, and the test network were isolated and cleaned up. No local dependency installs, image pulls, or committed test suite were added.Implementation details and manual verification are recorded in
_readme/internal-notes.md.