Inventory Sorter

Inventory Sorter

54M Downloads

Download access denied - inventorysorter-1.12.2-1.13.1+55.jar

joakime opened this issue · 3 comments

commented

Attempt to download inventorysorter-1.12.2-1.13.1+55.jar from
https://minecraft.curseforge.com/projects/inventory-sorter/files

results in Access Denied.

commented

Interestingly, its a URL encoding issue.

The URL that curseforge.com gives you is ...

https://media.forgecdn.net/files/2520/96/inventorysorter-1.12.2-1.13.1+55.jar

But the correct one (which does work) is ...

https://media.forgecdn.net/files/2520/96/inventorysorter-1.12.2-1.13.1%2B55.jar

(The + is correctly encoded to %2B)

Would recommend you don't use + in your filename.

commented

Why not? That is the correct way to encode + and it should be expected, since + is also a get parameter separator.

commented

Curseforge fixed this for you. 👍

It's now (3 days ago this wasn't true) encoding the filename during the final CDN redirect to correct the bad encoding.

$ wget --verbose https://minecraft.curseforge.com/projects/inventory-sorter/files/2520096/download
--2018-01-25 10:30:02--  https://minecraft.curseforge.com/projects/inventory-sorter/files/2520096/download
Resolving minecraft.curseforge.com (minecraft.curseforge.com)... 104.17.150.103, 104.17.151.103, 104.17.149.103, ...
Connecting to minecraft.curseforge.com (minecraft.curseforge.com)|104.17.150.103|:443... connected.
HTTP request sent, awaiting response... 307 Temporary Redirect
Location: https://addons.cursecdn.com/files/2520/96/inventorysorter-1.12.2-1.13.1+55.jar 

The above filename in Location: is what you have on your curseforge page.
The user agent requests this raw filename, with the literal + ...

[following]
--2018-01-25 10:30:03--  https://addons.cursecdn.com/files/2520/96/inventorysorter-1.12.2-1.13.1+55.jar
Resolving addons.cursecdn.com (addons.cursecdn.com)... 104.16.83.211, 104.16.81.211, 104.16.85.211, ...
Connecting to addons.cursecdn.com (addons.cursecdn.com)|104.16.83.211|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://media.forgecdn.net/files/2520/96/inventorysorter-1.12.2-1.13.1%2B55.jar 

Which curseforge.com now sees and fixes the encoding (using the %2B escaping) with the final 302 redirect to the forgeCDN.

Which allows the download to succeed on the next request to the file on the CDN.

[following]
--2018-01-25 10:30:03--  https://media.forgecdn.net/files/2520/96/inventorysorter-1.12.2-1.13.1%2B55.jar
Resolving media.forgecdn.net (media.forgecdn.net)... 52.85.202.147
Connecting to media.forgecdn.net (media.forgecdn.net)|52.85.202.147|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 46420 (45K) [application/octet-stream]
Saving to: ‘download’

download                         100%[==========================================================>]  45.33K  --.-KB/s    in 0.02s

2018-01-25 10:30:03 (2.49 MB/s) - ‘download’ saved [46420/46420]