You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if the agent is created with proxy URL that results in redirects, then the requests to list and read pending requests will work, but any attempts to post back the response will fail.
This is because the response is sent to the proxy with a POST request, but the redirect will cause the request method to change from POST to GET.
This is especially problematic because it is silently done. The agent thinks it is sending a POST but the proxy thinks it is getting a GET, and neither side logs anything about this change.
Ideally, we would not change the method on a redirect, but at the very least we should detect if the method has changed and report an error if that happens.
It looks like we can implement the detect-and-error approach by defining a non-nil CheckRedirect field in our http.Client struct. We can define one that compares the method of the new request against the method of the old request(s), and return an error if they do not match.
We would need to define that field on the client used for sending requests to the proxy, which is defined here
The text was updated successfully, but these errors were encountered:
Currently, if the agent is created with proxy URL that results in redirects, then the requests to list and read pending requests will work, but any attempts to post back the response will fail.
This is because the response is sent to the proxy with a POST request, but the redirect will cause the request method to change from POST to GET.
This is especially problematic because it is silently done. The agent thinks it is sending a POST but the proxy thinks it is getting a GET, and neither side logs anything about this change.
Ideally, we would not change the method on a redirect, but at the very least we should detect if the method has changed and report an error if that happens.
It looks like we can implement the detect-and-error approach by defining a non-nil CheckRedirect field in our http.Client struct. We can define one that compares the method of the new request against the method of the old request(s), and return an error if they do not match.
We would need to define that field on the client used for sending requests to the proxy, which is defined here
The text was updated successfully, but these errors were encountered: