Skip to content

fix: consolidate request+codegen headers+authorization [INS-4925] - #8345

Merged
ryan-willis merged 7 commits into
Kong:developfrom
ryanexus:fix/folder-headers-context
Feb 12, 2025
Merged

fix: consolidate request+codegen headers+authorization [INS-4925]#8345
ryan-willis merged 7 commits into
Kong:developfrom
ryanexus:fix/folder-headers-context

Conversation

@ryan-willis

@ryan-willis ryan-willis commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

Every call to fetchRequestData was followed by a call to tryToInterpolateRequest which would in turn call getRenderedRequestAndContext. This change removes the headers+authorization lines from fetchRequestData in favor of later construction in getRenderedRequestAndContext.

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.set instead of Headers.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

@ryan-willis
ryan-willis marked this pull request as draft February 7, 2025 21:24
@ryan-willis
ryan-willis force-pushed the fix/folder-headers-context branch from c1ae439 to 6a82156 Compare February 7, 2025 21:42
@ryan-willis
ryan-willis marked this pull request as ready for review February 10, 2025 23:58
@ryan-willis
ryan-willis force-pushed the fix/folder-headers-context branch from ea5c025 to 6996d10 Compare February 11, 2025 14:12
@ryan-willis
ryan-willis merged commit 56f37cc into Kong:develop 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
@ryan-willis
ryan-willis deleted the fix/folder-headers-context branch February 17, 2025 14:27
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