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 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

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.

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
Copy link
Member Author

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

@vszakats vszakats closed this in cdb6306 Feb 16, 2021
@vszakats vszakats deleted the referempty branch February 19, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants