Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: do not add a referrer header with empty value #6610

Closed
wants to merge 4 commits into from

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Feb 15, 2021

Previously an empty 'Referer:' header was added to the HTTP request when passing --referer ';auto' or --referer '' on the command-line. This patch makes --referer work like --header 'Referer:' and will only add the header if it has a non-zero length value.

@jay
Copy link
Member

@jay jay commented Feb 15, 2021

Previously an empty Referer: header was added to the request when passing --referer ';auto' on the command-line.

That should not be the case but this change blocks --referer "" though I can't imagine why one would do that.

@vszakats
Copy link
Member Author

@vszakats vszakats commented Feb 15, 2021

Yes, it will block passing an empty referrer header. On the receiving end a non-existing header should be equivalent to one that has an empty value. Unless I'm missing something.

This change will also make --referer work like --header does, where --header 'Referer:' will not send an empty "Referer:" header either.

@vszakats vszakats force-pushed the vszakats:referempty branch from a8f2891 to c842223 Feb 15, 2021
Previously an empty 'Referer:' header was added to the HTTP request when
passing `--referer ';auto'` or `--referer ''` on the command-line. This
patch makes `--referer` work like `--header 'Referer:'` and will only add
the header if it has a non-zero length value.

Closes #xxxx
@vszakats vszakats changed the title referrer: do not add a header for empty values http: do not add a referrer header with empty value Feb 15, 2021
@vszakats vszakats force-pushed the vszakats:referempty branch from c842223 to 5c3a2a5 Feb 16, 2021
@vszakats
Copy link
Member Author

@vszakats vszakats commented Feb 16, 2021

Updated to clear a previously set referrer when an empty value is passed, restoring original behaviour in this respect.

vszakats added 2 commits Feb 16, 2021
@jay
jay approved these changes Feb 16, 2021
@vszakats vszakats closed this in cdb6306 Feb 16, 2021
@vszakats vszakats deleted the vszakats:referempty branch Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants