Skip to content

chore(volo-http): refactor RequestPartsExt#501

Merged
yukiiiteru merged 1 commit intocloudwego:mainfrom
yukiiiteru:chore/request-ext
Sep 24, 2024
Merged

chore(volo-http): refactor RequestPartsExt#501
yukiiiteru merged 1 commit intocloudwego:mainfrom
yukiiiteru:chore/request-ext

Conversation

@yukiiiteru
Copy link
Copy Markdown
Contributor

Motivation

The previous implementation of RequestPartsExt was inelegant and somewhat inaccurate.

Solution

Remove most functions in RequestPartsExt, implement it for both http::request::Parts and http::request::Request, move it from volo_http::context::server to volo_http::request.

In addition, we added two HeaderName (X-Forwarded-For and X-Real-IP) for future use.

@yukiiiteru yukiiiteru requested review from a team as code owners September 24, 2024 12:04
PureWhiteWu
PureWhiteWu previously approved these changes Sep 24, 2024
Ggiggle
Ggiggle previously approved these changes Sep 24, 2024
The previous implementation of `RequestPartsExt` was inelegant and
somewhat inaccurate, so we remove most functions in `RequestPartsExt`,
implement it for both `http::request::Parts` and
`http::request::Request`, move it from `volo_http::context::server` to
`volo_http::request`.

In addition, `RequestPartsExt::full_uri` has been changed to extractor
`FullUri` because it depends status of tls.

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
@yukiiiteru yukiiiteru enabled auto-merge (squash) September 24, 2024 12:57
@yukiiiteru yukiiiteru merged commit 3e51290 into cloudwego:main Sep 24, 2024
@yukiiiteru yukiiiteru deleted the chore/request-ext branch September 24, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants