'webinterface: Get Bad Request when clicking "URL to file:"
if I use the webinterface to download a file via the "URL to file" link I get an error saying "HTTP Status 400 – Bad Request" (in JSON Format).
Tried Firefox and Chrome. Artifactory is 7.25.7 on Ubuntu 18.
Anyone an idea?
Best Regards Sven
Solution 1:[1]
Try adding "org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true" to your app/artifactory/tomcat/conf/catalina.properties file and then restart artifactory. I've got the exact same issue right now on version 7.23.3. Apparently there is a bug that the slash encoding is not getting set for some reason. Everything works fine except for downloading via the GUI, and pulling down NPM scoped packages. I've had a ticket open with jfrog about this for a while now. There is a setting you should be able to put in your yaml file, but that unfortunately doesn't work either. Hopefully they can sort this out as its a step you have to remember to do post upgrade since the above change gets removed as part of that process.
Solution 2:[2]
I had the exact same problem after upgrading the binaries from Artifactory 7.24.3 to 7.27.15 and although I didn't need to add in org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true, apparently adding it to the bottom of the catalina.properties file just fixed this problem for me. Still don't get why it doesn't get picked up in the YAML file or why it worked before the upgrade.
I did determine that the reason for the 400 error is due to the percent sign in the API v1 endpoint that gets called is getting encoded, so stuff like %2F gets called on as %252F.
Also, if you're running Nginx in front of Artifactory, you still might need the following to make your npm work:
location ~ ^/artifactory/ {
proxy_pass http://127.0.0.1:8081$uri;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Jon |
