Skip to content

Commit

Permalink
Resolve host for relative redirects
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Mar 17, 2023
1 parent f36a233 commit b09d4d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/groovy/io/seqera/wave/proxy/ProxyClient.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ class ProxyClient {
final msg = "Missing `Location` header for request URI '$target' ― origin request '$origin'"
throw new ClientResponseException(msg, result.request())
}
target = new URI(redirect)
// the redirect location can be a relative path i.e. without hostname
// therefore resolve it against the target registry hostname
target = registry.host.resolve(redirect)
if( target in visited ) {
final msg = "Redirect location already visited: $redirect ― origin request '$origin'"
throw new ClientResponseException(msg, result.request())
Expand Down

0 comments on commit b09d4d7

Please sign in to comment.