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

Case-sensitive headers #2008

Merged
merged 17 commits into from
Nov 25, 2023
Merged

Case-sensitive headers #2008

merged 17 commits into from
Nov 25, 2023

Conversation

AlexV525
Copy link
Member

@AlexV525 AlexV525 commented Oct 23, 2023

Fixes #2002 #1102 #788 #641

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • 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.

dio/lib/src/options.dart Outdated Show resolved Hide resolved
@AlexV525

This comment was marked as outdated.

@AlexV525
Copy link
Member Author

The options tests is blocked by sharat87/httpbun#11.

@AlexV525 AlexV525 marked this pull request as ready for review October 24, 2023 14:05
@AlexV525 AlexV525 requested a review from a team as a code owner October 24, 2023 14:05
@kuhnroyal
Copy link
Member

No idea but you seem to have solved it. Probably re-generate with build_runner.

dio/lib/src/dio_mixin.dart Outdated Show resolved Hide resolved
dio/lib/src/options.dart Show resolved Hide resolved
@shinexoh

This comment was marked as off-topic.

@ueman
Copy link
Contributor

ueman commented Oct 25, 2023

Apparently, this is a breaking change since it breaks tests for the native dio adapter:

error - lib/src/conversion_layer_adapter.dart:46:21 - The getter 'preserveHeaderCase' isn't defined for the type 'RequestOptions'. Try importing the library that defines 'preserveHeaderCase', correcting the name to the name of an existing getter, or defining a getter or field named 'preserveHeaderCase'. - undefined_getter
error - lib/src/conversion_layer_adapter.dart:78:17 - The getter 'preserveHeaderCase' isn't defined for the type 'RequestOptions'. Try importing the library that defines 'preserveHeaderCase', correcting the name to the name of an existing getter, or defining a getter or field named 'preserveHeaderCase'. - undefined_getter

as seen in https://github.com/cfug/dio/actions/runs/6641569223/job/18044420186?pr=2008

I do wonder though, why it's not a problem for the http2 client.

@AlexV525
Copy link
Member Author

Apparently, this is a breaking change since it breaks tests for the native dio adapter:
I do wonder though, why it's not a problem for the http2 client.

Because we didn't setup melos properly for packages during tests. So the native package is using the latest dio from the pub.dev.

@AlexV525
Copy link
Member Author

I'll tweak melos configs somedays later before I fixes these tests. Before that, the overall implementation can be reviewed.

Copy link
Member

@kuhnroyal kuhnroyal left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexV525
Copy link
Member Author

AlexV525 commented Nov 9, 2023

Yep. The analysis passed as expected. The last thing would be fixing headers conversion.

@AlexV525 AlexV525 added the p: dio Targeting `dio` package label Nov 13, 2023
@AlexV525
Copy link
Member Author

Since we cannot get the compatibility from httpbun, we need to update the tests accordingly.

@AlexV525 AlexV525 marked this pull request as draft November 20, 2023 02:43
@AlexV525 AlexV525 marked this pull request as ready for review November 25, 2023 07:20
@AlexV525
Copy link
Member Author

Finally, mastering Mockito. :)

@AlexV525 AlexV525 added the s: feature This issue indicates a feature request label Nov 25, 2023
@AlexV525 AlexV525 added this pull request to the merge queue Nov 25, 2023
Merged via the queue into main with commit 4d61f65 Nov 25, 2023
3 checks passed
@AlexV525 AlexV525 deleted the feat/case-sensitive-headers branch November 25, 2023 11:15
@AlexV525 AlexV525 added the valuable The issue or the fix means a lot to the library. label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: dio Targeting `dio` package s: feature This issue indicates a feature request valuable The issue or the fix means a lot to the library.
Projects
None yet
4 participants