-
Notifications
You must be signed in to change notification settings - Fork 811
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
feat(webhook): add new webhook.followRedirects property #4838
Conversation
to pave the way for a new followRedirects config property.
Default to true so there's no behavior change. When false, don't follow redirects in webhook stages.
@@ -114,11 +114,18 @@ public ClientHttpRequestFactory webhookRequestFactory( | |||
|
|||
validateResponseSize(response, webhookProperties.getMaxResponseBytes()); | |||
|
|||
if (webhookProperties.isVerifyRedirects() && response.isRedirect()) { | |||
// verify that we are not redirecting to a restricted url | |||
if (response.isRedirect()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I see we have this validateRequestSize
and validateResponseSize
, would it make sense to move this to a method called validateAnyRedirects
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't decide the isRedirect
method name here. It's a method on the okhttp3.Response class.
We do get to decide property names though, and I figured followRedirects
was consistent with the existing verifyRedirects
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaah, I see...We could move all this logic to a separate method for handling redirect validation...yes, that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor comment. Mostly for consistency
Default to true so there's no behavior change. When false, don't follow redirects in webhook stages.