Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API/Hangar site gives download link that results in a 404 error #1279

Closed
DaBlaze opened this issue Oct 31, 2023 · 1 comment
Closed

API/Hangar site gives download link that results in a 404 error #1279

DaBlaze opened this issue Oct 31, 2023 · 1 comment

Comments

@DaBlaze
Copy link

DaBlaze commented Oct 31, 2023

Observed/problematic behavior

After contacting the API for information about a version of a plugin, the downloadUrl is incorrect and results in a 404 error. This also seems to be an issue on the Hangar site as well when downloading plugin jar files.

Expected behavior

The plugin jar file would be downloaded.

Steps to reproduce

Way one:

  1. Ask the API for information regarding a plugin version using a request like this:
    https://hangar.papermc.io/api/v1/projects/viaversion/versions/4.8.1
  2. In the returned JSON, get the download link from: downloads > PAPER > downloadUrl
    Screenshot 2023-10-31 at 15-53-38 API Docs Hangar
  3. Try to download the plugin jar file with the downloadUrl.
  4. The 404 arises when trying to download from the downloadUrl link given.
    Screenshot 2023-10-31 155649

Way Two:

  1. Find plugin on Hangar site
  2. Attempt to download plugin jar file
  3. 404 error

Other

The issue arises from the capitalization not being exact on the plugin name portion of the link.

Correctly Formatted Download Link:
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/4.8.1/PAPER/ViaVersion-4.8.1.jar

Incorrectly Formatted Download Link Given by API:
https://hangarcdn.papermc.io/plugins/ViaVersion/viaversion/versions/4.8.1/PAPER/ViaVersion-4.8.1.jar

This issue seems to happen randomly as sometimes the API responds with the correct download link but other times will give a wrongly formatted one. The only thing I can think of is the API passing the lowercase plugin slug directly into the link rather than the properly capitalized plugin name? Or maybe the plugin name is incorrectly being lowercased at some point?

@DaBlaze DaBlaze changed the title API/Hangar site gives download link that resolves in a 404 error API/Hangar site gives download link that results in a 404 error Oct 31, 2023
@MiniDigger
Copy link
Member

its not consistent because stuff is cached, but I think I found the cause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants