Open bhearn7 opened 3 years ago
@bhearn7 thanks for the leg work on the investigation! After going through redirect docs for requests, confirmed that all 301 redirects are converted into GET by requests library by default, regardless of the initial verb. This may not match the HTTP RFC linked in the description. Need to investigate further if there's a way to force the requests library to use the same verb (by breaking down the single call with a call to check redirect and construct a request with the new url but that has its complications when theres more than 1 redirect). Another workaround is your observation, failing the original request when a redirect is encountered. That might be possible by disabling redirects in requests invocation https://docs.python-requests.org/en/latest/user/quickstart/#redirection-and-history The question then is should we disable redirects for all requests or just the non-GETs
Version: 0.9.1 OS: Mac
Cluster Mesh: Istio
Issue: when attempting an anchore-cli POST command from outside the cluster using http and port 80,
requests
changes the POST to GET for 301's, resulting in blank cli outputLinks:
Examples:
Expected output: Error, Failure, or Redirect warning in cli output