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

Redirection heuristic for #113 #114

Merged
merged 3 commits into from
Jul 6, 2017

Conversation

Mrmaxmeier
Copy link
Contributor

@Mrmaxmeier Mrmaxmeier commented Jul 5, 2017

I've tried to keep the heuristic general and avoid false-negatives as it only interferes if the last segment of the URL doesn't contain a .
(This will separates hash-like URLs from ones that contain a file extension)

Closes #113

@pkgw
Copy link
Collaborator

pkgw commented Jul 5, 2017

@Mrmaxmeier Thanks for tackling this! Do you understand the problem that's occurring in #113, then? I've been puzzled since I simply don't get that amount of redirection when I run the program myself. It doesn't seem like the redirects should be location-dependent, but I don't know a lot about how modern CDNs work.

@Mrmaxmeier
Copy link
Contributor Author

Mrmaxmeier commented Jul 5, 2017

@pkgw I guess Bintray only redirects to a CDN if it knows of a server that's in the general location of the request IP.
I'm not really sure though as I've used tectonic from my location (Europe) before and have not experienced this problem until now.

For reference: Here's the chain of redirects I get when resolving the URL:

curl -v -L https://purl.org/net/pkgwpub/tectonic-default
> GET /net/pkgwpub/tectonic-default HTTP/1.1
< HTTP/1.1 302 FOUND
< Location: https://dl.bintray.com/pkgw/tectonic/tl2016extras/2016.0r4/tlextras-2016.0r4.tar
...
> GET /pkgw/tectonic/tl2016extras/2016.0r4/tlextras-2016.0r4.tar HTTP/1.1
< HTTP/1.1 302 
< Location: https://akamai.bintray.com/59/59eecf9d49e259191ef66cb68b274c7c50fa20a75f593130d2603176418422eb?__gda__=exp=1499264990~hmac=bd70aaa3f2249e31aca70cf040e04d21132e19d1f9c27b63e9664ea8bd2f23fb&response-content-disposition=attachment%3Bfilename%3D%22tlextras-2016.0r4.tar%22&response-content-type=application%2Fx-tar&requestInfo=U2FsdGVkX19GOYzRiCoj7rRz6RTs24E4yUI2Wc3mKyq97fRbWcXx6QUWVJIpPjGn_2vPkzFEFkf_CNb6McWXfn2ickRChp6BZ4EwYa7POzj6lDugKNwDm4waK5LUo210UPGRCWIzzBooxHoj1ie5Kg
...
> GET /59/59eecf9d49e259191ef66cb68b274c7c50fa20a75f593130d2603176418422eb?__gda__=exp=1499265082~hmac=9297d5a6259c63dc9d1c58ef972177e228f5912143ea8631513b420bdff17c57&response-content-disposition=attachment%3Bfilename%3D%22tlextras-2016.0r4.tar%22&response-content-type=application%2Fx-tar&requestInfo=U2FsdGVkX1-fRImzfVxqor3YiRC3T5jXzJDLfhnflJi3TPK60FLOJ0GbGJZ6xbrEsTH85PlaOZVG492ak-kzjAA-1XasiputOmb1wJyjxoxy18bZjv2QUKuRhb07RMxaEwwAiYRLjKq3iejxpm7EBA HTTP/1.1
> Host: akamai.bintray.com
< HTTP/1.1 200 OK

This fix is needed for Rust < 1.19
(see rust issue #39817)
@19h
Copy link

19h commented Jul 6, 2017

Yes, this is it. And yes, this fixes it. Good job and -- thanks.

🍻

@pkgw
Copy link
Collaborator

pkgw commented Jul 6, 2017

Ah, interesting. I've been blocking the 0.1.6 release on writing a skeleton manual but this seems like an important enough fix to be worth cutting a release even if I can't complete that task, which is looking like it's going to take a long time due to non-Tectonic obligations. I will aim to do so this weekend.

Thanks for the very rapid fix!

@pkgw pkgw merged commit 1f25a69 into tectonic-typesetting:master Jul 6, 2017
@Mrmaxmeier Mrmaxmeier deleted the redirect-heuristic branch November 26, 2017 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants