Skip to content

Allow mixed key types for parts headers - #79

Merged
ioquatix merged 2 commits into
socketry:mainfrom
jasonyork:master
Jun 2, 2022
Merged

Allow mixed key types for parts headers#79
ioquatix merged 2 commits into
socketry:mainfrom
jasonyork:master

Conversation

@jasonyork

Copy link
Copy Markdown
Contributor

Description

I ran into this issue when attempting to implement the Parts Headers example

If the param has a string key, but the key in the headers is a symbol, the additional headers will not be supplied. In the example in the README the following key is a string:

"file_metadata_01" => { "description" => "A nice picture!" }

while the header has a symbol for a key:

'file_metadata_01': { ... }

This example does not work with the current code.

Types of Changes

  • Bug fix.

This PR forces the keys to a symbol when retrieving the headers, ensuring a match.

Testing

  • I added tests for my changes.
  • I tested my changes locally.

Comment thread spec/net/http/post/multipart_spec.rb Outdated
Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
@jasonyork

Copy link
Copy Markdown
Contributor Author

@patrickdavey - Do you have any feedback for me on this PR? Thanks.

@ioquatix
ioquatix merged commit 6d9baff into socketry:main Jun 2, 2022
@ioquatix

ioquatix commented Jun 2, 2022

Copy link
Copy Markdown
Member

This looks okay to me.

olleolleolle added a commit to olleolleolle/multipart-post that referenced this pull request Jun 2, 2022
@olleolleolle olleolleolle mentioned this pull request Jun 2, 2022
ioquatix pushed a commit that referenced this pull request Jun 2, 2022
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