Skip to content

fix(fetch/axios): correctly merge headers from opts#231

Merged
mnahkies merged 16 commits into
mainfrom
mn/fix/headers
Aug 17, 2024
Merged

fix(fetch/axios): correctly merge headers from opts#231
mnahkies merged 16 commits into
mainfrom
mn/fix/headers

Conversation

@mnahkies
Copy link
Copy Markdown
Owner

@mnahkies mnahkies commented Aug 11, 2024

  • Previously if you passed any request headers using the opts parameter, this would overwrite the headers set from parameters, defaults, etc
  • Now these will be consistently merged following: defaults -> params -> opts
    • undefined header values will be ignored, null header values will delete headers set previously

This wound up being a lot more complex than I'd expected, and there may still be some edges that I've missed. However I'm confident that this makes things better than before based on the new e2e tests at least.

@mnahkies mnahkies marked this pull request as ready for review August 11, 2024 13:30
@mnahkies mnahkies enabled auto-merge (squash) August 17, 2024 15:52
@mnahkies mnahkies merged commit 5efc36e into main Aug 17, 2024
@mnahkies mnahkies deleted the mn/fix/headers branch August 17, 2024 15:54
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