fix: consolidate request+codegen headers+authorization [INS-4925] - #8345
Merged
Conversation
ryan-willis
marked this pull request as draft
February 7, 2025 21:24
ryan-willis
force-pushed
the
fix/folder-headers-context
branch
from
February 7, 2025 21:42
c1ae439 to
6a82156
Compare
ryan-willis
marked this pull request as ready for review
February 10, 2025 23:58
ryan-willis
force-pushed
the
fix/folder-headers-context
branch
from
February 11, 2025 14:12
ea5c025 to
6996d10
Compare
jackkav
approved these changes
Feb 12, 2025
pavkout
pushed a commit
to pavkout/insomnia
that referenced
this pull request
Feb 17, 2025
…ng#8345) * fix: consolidate request+codegen headers+authorization
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.
Every call to
fetchRequestDatawas followed by a call totryToInterpolateRequestwhich would in turn callgetRenderedRequestAndContext. This change removes the headers+authorization lines fromfetchRequestDatain favor of later construction ingetRenderedRequestAndContext.I opted for the use of "native" (fetch)
Headers, which preserves the join-with-comma side effect produced from duplicated headers, but added prevention for a select list of headers that would become invalid from the same side effect, and maintained the case-sensitivity for backward compatibility (even though the spec declares headers as case-insensitive).I'm not particularly satisfied with this approach, I think we should simply prefer more immediate headers (request>folder/group) and prevent the join-with-comma side effect from happening at all by calling
Headers.setinstead ofHeaders.append.This also has the potential to be a risky change, particularly for the OAuth token flow, so I'll run through some tests to make sure I'm not breaking anything