Skip to content

Commit

Permalink
fix: Adapt to recent changes in JDK download URL response
Browse files Browse the repository at this point in the history
Parse the JDK redirect URL for a case insensitive redirect location

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307 shows the response as:

> location: /en-US/docs/Learn/JavaScript/Client-side_web_APIs/Fetching_data
> content-type: text/plain; charset=utf-8
> date: Fri, 19 Jul 2024 12:57:17 GMT

Previously, the response must have used "Location:" rather than "location:"
  • Loading branch information
MarkEWaite committed Oct 6, 2024
1 parent 9406a47 commit 60d14cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jdk-download-url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ for ARCH in $ARCHS; do
fi

# Extract the redirect URL from the HTTP response
REDIRECTED_URL=$(echo "$RESPONSE" | grep Location | awk '{print $2}' | tr -d '\r')
REDIRECTED_URL=$(echo "$RESPONSE" | grep -i location | awk '{print $2}' | tr -d '\r')

# If no redirect URL was found, exit the script with an error message
if [ -z "$REDIRECTED_URL" ]; then
Expand Down

0 comments on commit 60d14cf

Please sign in to comment.