Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@knaeckeKami
Copy link
Collaborator

@knaeckeKami knaeckeKami commented Nov 12, 2022

@ueman fyi

Comment on lines +44 to +45
Map<String, String>? headers,
Map<String, List<String>>? rawHeaders,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need both of these header maps?

Copy link
Collaborator Author

@knaeckeKami knaeckeKami Nov 12, 2022

Choose a reason for hiding this comment

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

http headers can be repeated. package:http does not support this, but dio does. See https://www.rfc-editor.org/rfc/rfc2616.html#section-4.2

So the alternatives are:

  • only adding the Map<String, List> headers, but this would be a breaking change, and also would make the API more awkward for use cases that don't need repeated headers
  • not support repeated headers at all
  • add both

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh TIL

@knaeckeKami knaeckeKami force-pushed the fix/shared-context-fixes branch from 7577750 to 096c803 Compare November 12, 2022 22:11
@knaeckeKami knaeckeKami force-pushed the fix/shared-context-fixes branch from 096c803 to 866213c Compare November 12, 2022 22:21
@knaeckeKami knaeckeKami merged commit dd9a043 into master Nov 13, 2022
@knaeckeKami knaeckeKami deleted the fix/shared-context-fixes branch November 13, 2022 10:13
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.

3 participants