Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The request headers key changes to lowercase #2002

Closed
hnsycsxhzcsh opened this issue Oct 18, 2023 · 6 comments · Fixed by #2008
Closed

The request headers key changes to lowercase #2002

hnsycsxhzcsh opened this issue Oct 18, 2023 · 6 comments · Fixed by #2008
Labels
fixed p: dio Targeting `dio` package s: feature This issue indicates a feature request

Comments

@hnsycsxhzcsh
Copy link

Request Statement

When I made a network request, Authorization was added to the network request headers, but the result was changed to lowercase.
example:
var dio = Dio(); Options options = Options(headers: {"Authorization": "Basic xxx"}); Response response = await dio.get(“xxx” options: options, );

276073621-af600c08-56c8-47ab-9610-e58857286808

Solution Brainstorm

No response

@hnsycsxhzcsh hnsycsxhzcsh added the s: feature This issue indicates a feature request label Oct 18, 2023
@ueman
Copy link
Contributor

ueman commented Oct 21, 2023

HTTP headers are defined as being case insensitive, which means Authorization and authorization are identical.

What exactly, is your problem @hnsycsxhzcsh ?

@ueman ueman added h: need more info Further information is requested and removed s: feature This issue indicates a feature request labels Oct 21, 2023
@hnsycsxhzcsh
Copy link
Author

hnsycsxhzcsh commented Oct 23, 2023 via email

@hnsycsxhzcsh

This comment was marked as duplicate.

@ueman
Copy link
Contributor

ueman commented Oct 23, 2023

I understand that, but why does it need to start with an upper case A?

@hnsycsxhzcsh
Copy link
Author

hnsycsxhzcsh commented Oct 23, 2023 via email

@AlexV525
Copy link
Member

I've tried to solve this multiple times and ended up with a complicated but different solution every time. I'll try again to see if I can make any difference this time.

P.S. We've been involved with customized headers and headers from the io package, which causes a significant amount of transformation code has be written during the implementation.

@AlexV525 AlexV525 added s: feature This issue indicates a feature request p: dio Targeting `dio` package and removed h: need more info Further information is requested labels Oct 23, 2023
@AlexV525 AlexV525 mentioned this issue Oct 23, 2023
7 tasks
github-merge-queue bot pushed a commit that referenced this issue Nov 25, 2023
Fixes #2002 #1102 #788 #641

### New Pull Request Checklist

- [x] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [x] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [x] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [x] I have added the required tests to prove the fix/feature I'm
adding
- [x] I have updated the documentation (if necessary)
- [x] I have run the tests without failures
- [x] I have updated the `CHANGELOG.md` in the corresponding package

### Additional context and info (if any)

We have `camelCaseContentDisposition` for `FormData` but this is not
related.

---------

Signed-off-by: Alex Li <[email protected]>
@AlexV525 AlexV525 added the fixed label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed p: dio Targeting `dio` package s: feature This issue indicates a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants