Comments (8)
May I ask why using Gradle
as User-Agent
gets a different treatment and works? Funny enough, my interest in this API is driven by supporting AdoptOpenJDK in Gradle ;)
from openjdk-api-v3.
I can reproduce your curl request error, and adding -H "user-agent: Gradle"
to the end seems to fix it. Not sure if that behavior was intentional but seems kinda buggy to me. (Unless it's a weird limitation of the service provider or something like that) (this appears to be intended behavior per the tests)
from openjdk-api-v3.
A test attempting to replicate the failure can be found here (sorry about all the reference noise above).
On second thought, I think the test failure here is just due to missing test fixture data (it returns 404 instead of 403). The same test passes with jdk8u212-b04
, which also returns a 403 using the curl
command mentioned above.
from openjdk-api-v3.
It appears that this may be related to the way AWS handles (or does not handle) HEAD
requests. If I include the --cookie
option like so:
curl -v -L --cookie --head "https://api.adoptopenjdk.net/v3/binary/version/jdk-11.0.6%2B10/linux/x64/jdk/hotspot/normal/adoptopenjdk?project=jdk"
Then the API -> GitHub -> AWS redirect goes through, then proceeds to vomit binary into my terminal until I have to force close it.
You can see the same behavior by hitting the GitHub release URL (with -L
) or the AWS redirect URL (without -L
) directly.
from openjdk-api-v3.
Ah yes, our API does require a user agent - CC @johnoliver for more context
from openjdk-api-v3.
It was originally put in to allow Gradle to download our binaries (see elastic/elasticsearch#55125 and https://github.com/elastic/elasticsearch/pull/55127/files @james-crowley may be able to give more context there) and yes this was to be a work around for the fact that aws did not allow HEAD requests and Gradle required them to work.
In general I am not a fan of our current HEAD behaviour as (from my reading of it) HEAD should return the same as GET, but to work around the aws and gradle issues HEAD (with the gradle user agent) will return a response while GET will redirect you. As this is non standard we felt it was better to limit the effect to gradle only. Unfortunately adding the functionality highlights HEAD in the swagger docs, I could not find a way to hide the HEAD request from the documentation which is not ideal.
from openjdk-api-v3.
@johnoliver Thanks for tagging me in this issue. @bmuskalla like @johnoliver mentioned this implementation of checking if the user-agent is Gradle
was due to AWS not allowing HEAD
requests.
In my digging around I did find this issue/comment, gradle/gradle#5322 (comment). I was excited to see that Gradle worked with GitHub to support HEAD
requests. When trying to fetch the AdoptOpenJDK file, GitHub redirects to AWS and Gradle tries to do a HEAD
request on AWS but AWS does not support HEAD
requests. Thus downloading the file fails and errors out when building with Gradle.
I agree with @johnoliver, this implementation in the API is not ideal. @bmuskalla is there anything on Gradle’s side of things that can be implemented to fix this bug? Also let me know if I can help with anything. Glad to see AdoptOpenJDK support coming to Gradle!
from openjdk-api-v3.
This has been resolved
from openjdk-api-v3.
Related Issues (20)
- Possibly(?) incorrect parsing in /v3/version/{version} HOT 1
- Introduce one-stop-shop endpoint for updates HOT 4
- Make it possible to download Dragonwell nightly builds HOT 1
- Consider increasing max page_size > 20 HOT 12
- OpenJ9-Versions cannot be used for info URL HOT 2
- Please sign archives HOT 1
- Add Dragonwell in openjdk-api/v3/binary HOT 2
- Speed is slow when returning info from an end point HOT 2
- OutOfMemoryError on docker-compose build frontend HOT 2
- Adopt OpenJDK binaries are not available for Windows x86 arch HOT 10
- Bintray Sunset - API docker build failed 403 on nodes-0.5.0.pom HOT 3
- Remove duplication of platforms.json and variants.json HOT 1
- Website is not showing latest HotSpot nightlies for JDK16 HOT 8
- Is there a list of file types somewhere? HOT 1
- Latest 17-ea not returned by API HOT 3
- Update AdoptOpenJDK API to redirect requests for July PSU builds to Eclipse Temurin binaries at Eclipse Adoptium HOT 1
- Wrong checksum for IBM Semeru JDK version 8u302b08 on macOS HOT 1
- p
- LTS list does not include Java 17
- "NOTICE" links on https://api.adoptopenjdk.net/q/swagger-ui/ broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openjdk-api-v3.