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

cleanup: common funcs for setting headers #1332

Merged
merged 3 commits into from
Sep 28, 2023
Merged

cleanup: common funcs for setting headers #1332

merged 3 commits into from
Sep 28, 2023

Conversation

bassosimone
Copy link
Contributor

I was trying to make sure the code was using a new definition of headers based on ArchivalMaybeBinaryString, but I stumbled upon a roadblock where there were too many code paths settings headers.

I did not feel comfortable changing multiple code paths, so here is instead a diff that unifies setting headers.

The slightly tricky part of this diff has been the requirement that we preserve headers' capitalization for hhfm. The catch seems to be that we should not use http.Header for setting the headers in hhfm, but rather pass through map[string][]string, which is not attached case normalization setters. I think we're fine in this department because we already had test cases and I added a bunch more test cases.

After this diff is merged, I can resume with my plan to make headers use ArchivalMaybeBinaryString, which, in turn, is functional to automatically scrub headers, which is something we would like to happen in light of the introduction of more happy eyeballs code due to ooni/probe#2531.

I was trying to make sure the code was using a new definition of
headers based on ArchivalMaybeBinaryString, but I stumbled upon a
roadblock where there were too many code paths settings headers.

I did not feel comfortable changing multiple code paths, so here
is instead a diff that unifies setting headers.

The slightly tricky part of this diff has been the requirement
that we preserve headers' capitalization for hhfm. The catch
seems to be that we should not use http.Header for setting the
headers in hhfm, but rather pass through map[string][]string,
which is not attached case normalization setters. I think we're
fine in this department because we already had test cases and
I added a bunch more test cases.

After this diff is merged, I can resume with my plan to make
headers use ArchivalMaybeBinaryString, which, in turn, is functional
to automatically scrub headers, which is something we would like to
happen in light of the introduction of more happy eyeballs code
due to ooni/probe#2531.
@bassosimone bassosimone merged commit 3a350e8 into master Sep 28, 2023
@bassosimone bassosimone deleted the issue/2531 branch September 28, 2023 18:39
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
I was trying to make sure the code was using a new definition of headers
based on ArchivalMaybeBinaryString, but I stumbled upon a roadblock
where there were too many code paths settings headers.

I did not feel comfortable changing multiple code paths, so here is
instead a diff that unifies setting headers.

The slightly tricky part of this diff has been the requirement that we
preserve headers' capitalization for hhfm. The catch seems to be that we
should not use http.Header for setting the headers in hhfm, but rather
pass through map[string][]string, which is not attached case
normalization setters. I think we're fine in this department because we
already had test cases and I added a bunch more test cases.

After this diff is merged, I can resume with my plan to make headers use
ArchivalMaybeBinaryString, which, in turn, is functional to
automatically scrub headers, which is something we would like to happen
in light of the introduction of more happy eyeballs code due to
ooni/probe#2531.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant