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

Update req #3

Closed
wants to merge 0 commits into from
Closed

Update req #3

wants to merge 0 commits into from

Conversation

ckoch-cars
Copy link
Collaborator

Test the :legacy_headers_as_lists config.

@ckoch-cars ckoch-cars requested a review from a team September 26, 2023 19:49
@ckoch-cars
Copy link
Collaborator Author

Hi @wojtekmach, I am trying to test out the updated req and the config option :legacy_headers_as_lists.

Using Application.put_env/3 isn't working. Any suggestions on how we can test this config?

Copy link

@wojtekmach wojtekmach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legacy config is compile-time so unfortunately you won't be able to test both when it is enabled and when it is disabled. My suggestion is to not enable it on your projects. The transition is rough but I think ultimately worth it, I think the map semantics are much nicer here. However, if headers being maps are a deal breaker, i.e. not just a matter of updating the code but it breaks contracts with things outside of your control, please let us know.

@wojtekmach
Copy link

wojtekmach commented Sep 26, 2023

FYI some servers, even thought it is against spec, requires headers to be in particular case (we now downcase) and particular order (which we no longer have with maps) so I am planning to leave an escape hatch open and it might be to allow keeping headers as lists to keep order. I haven't thought this through but it might be that instead of headers be a %{String.t() => [String.t()]} map they would be an Enumerable.t({String.t(), [String.t()]) which would still be a breaking change (since the value is a list.)

@ckoch-cars
Copy link
Collaborator Author

The legacy config is compile-time so unfortunately you won't be able to test both when it is enabled and when it is disabled. My suggestion is to not enable it on your projects. The transition is rough but I think ultimately worth it, I think the map semantics are much nicer here. However, if headers being maps are a deal breaker, i.e. not just a matter of updating the code but it breaks contracts with things outside of your control, please let us know.

I'm trying to force the change in config.exs, but that config test is still failing.

I agree about updating the headers everywhere. Hopefully we don't have any services downstream that care about header casing, though there's probably an AWS service that does. 😀

@ckoch-cars
Copy link
Collaborator Author

The legacy config is compile-time so unfortunately you won't be able to test both when it is enabled and when it is disabled. My suggestion is to not enable it on your projects. The transition is rough but I think ultimately worth it, I think the map semantics are much nicer here. However, if headers being maps are a deal breaker, i.e. not just a matter of updating the code but it breaks contracts with things outside of your control, please let us know.

I'm trying to force the change in config.exs, but that config test is still failing.

I agree about updating the headers everywhere. Hopefully we don't have any services downstream that care about header casing, though there's probably an AWS service that does. 😀

UPDATE: I cleaned req and then recompiled and that got the update applied.

@wojtekmach
Copy link

wojtekmach commented Sep 26, 2023

Yeah I forgot to mention you need to recompile deps after changing compile-time configs. I believe on Elixir 1.16 that will no longer be necessary, that is, the compiler will know it needs to recompile.

@ckoch-cars ckoch-cars force-pushed the update_req branch 2 times, most recently from f8d3eef to 08f0fb0 Compare September 26, 2023 20:43
@ckoch-cars ckoch-cars added this pull request to the merge queue Sep 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 27, 2023
@ckoch-cars ckoch-cars closed this Sep 27, 2023
@ckoch-cars ckoch-cars deleted the update_req branch September 27, 2023 12:57
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.

2 participants