-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(volo-http): add mime parsing in server, do not always prefer ipv4…
… in client dns (#538) * chore(volo-http): mark some dependencies as optional * fix(volo-http): check content type through parsing content type In the previous implementation, the `Form` extractor directly compared `Content-Type` and rejected the form if `Content-Type` was not `application/x-www-form-urlencoded`. But sometimes `Content-Type` could be `application/x-www-form-urlencoded; charset=utf-8`, which is actually a valid mime for the form, but we incorrectly rejected it. This commit makes the current implementation check `Content-Type` by parsing instead of directly comparing the string. * fix(volo-http): prefer ipv6 addr in dns resolver when dns addr is ipv6 We use the `hickory_resolver` crate to resolve domain names, but we found that it always prefers IPv4 addresses, which doesn't work if the client is running in an IPv6 only environment. This commit fixes this by checking the first name server, if the address is an IPv4 address we keep preferring IPv4 addresses, if it is an IPv6 address we set the resolver to prefer IPv6 addresses. * chore(volo-http): bump Volo-HTTP to 0.3.0 Signed-off-by: Yu Li <[email protected]> --------- Signed-off-by: Yu Li <[email protected]>
- Loading branch information
1 parent
8b0f0cc
commit 661346b
Showing
4 changed files
with
58 additions
and
54 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters