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

fix(volo-http): use Option<CallOpt> rather than CallOpt #480

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

yukiiiteru
Copy link
Member

@yukiiiteru yukiiiteru commented Aug 1, 2024

Motivation

In the previous code, if there was a default Target and the request only had a CallOpt set, the new CallOpt would have no effect because the request had no Target.

Solution

This commit fixes this by replacing CallOpt with Option<CallOpt>. If we use the default target and there is only one CallOpt, we will use it directly, otherwise the target CallOpt will be used. If the request target is used, the default CallOpt will have no effect.

@yukiiiteru yukiiiteru requested review from a team as code owners August 1, 2024 07:16
PureWhiteWu
PureWhiteWu previously approved these changes Aug 1, 2024
@yukiiiteru yukiiiteru force-pushed the fix/option-callopt branch 2 times, most recently from 83294f9 to 34b881c Compare August 1, 2024 08:02
In the previous code, if there was a default `Target` and the request
only had a `CallOpt` set, the new `CallOpt` would have no effect
because the request had no `Target`.

This commit fixes this by replacing `CallOpt` with `Option<CallOpt>`.
If we use the default target and there is only one `CallOpt`, we will
use it directly, otherwise the target `CallOpt` will be used. If the
request target is used, the default `CallOpt` will have no effect.

Signed-off-by: Yu Li <[email protected]>
@yukiiiteru yukiiiteru merged commit b438e65 into cloudwego:main Aug 1, 2024
12 of 14 checks passed
@yukiiiteru yukiiiteru deleted the fix/option-callopt branch August 1, 2024 08:20
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.

2 participants