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

GH PDF Download Fails in Zinc, Works with curl #89

Open
seandenigris opened this issue Mar 27, 2022 · 4 comments
Open

GH PDF Download Fails in Zinc, Works with curl #89

seandenigris opened this issue Mar 27, 2022 · 4 comments

Comments

@seandenigris
Copy link

The following fails with a 401 error:

'https://github.com/SquareBracketAssociates/Booklet-DataFrame/releases/download/continuous/DataFrame-wip.pdf' asUrl saveContentsToFile: file.

But this works:

curl -Lo wip.pdf  https://github.com/SquareBracketAssociates/Booklet-DataFrame/releases/download/continuous/DataFrame-wip.pdf

NB it too fails without the -L. It downloads something but it is not a valid PDF

@svenvc
Copy link
Owner

svenvc commented Mar 27, 2022

Try:

ZnOptions globalDefault clone
  at: #queryKeyValueSafeSet put: (ZnOptions queryKeyValueSafeSet \ '/;');
  during: [ 'https://github.com/SquareBracketAssociates/Booklet-DataFrame/releases/download/continuous/DataFrame-wip.pdf' asUrl saveContentsToFile: '/tmp/foo.pdf' ].

See #69

@seandenigris
Copy link
Author

Thanks! I'm on GT, which has an older version of zinc. I asked on their Discord if they will update. Otherwise, I will try to update manually and report back...

@seandenigris
Copy link
Author

Thanks again. GT updated to latest Zinc on 3/3/2022 (per Discord) so I should be all set :)

@Rinzwind
Copy link

It’s maybe worth noting here the following two points from RFC 3986:

Semicolon (;) is reserved, tilde (~) is unreserved. So:

  • https://example.com/?; and https://example.com/?%3B are not equivalent
  • https://example.com/?~ and https://example.com/?%7E are equivalent

The way I understand this in the context of this issue is:

  • When I get a redirect to https://example.com/?%3B, but instead request https://example.com/?;: the server is allowed (but not required) to treat that as a different request than one using the URL that it gave me.
  • When I get a redirect to https://example.com/?%7E, but instead request https://example.com/?~: the server is required to treat that as the same request as one using the URL that it gave me.

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

No branches or pull requests

3 participants