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

http 302 redirect not handle properly #440

Open
elvizlai opened this issue May 30, 2024 · 1 comment
Open

http 302 redirect not handle properly #440

elvizlai opened this issue May 30, 2024 · 1 comment

Comments

@elvizlai
Copy link

for example:

wget https://huggingface.co/ostris/ip-composition-adapter/resolve/main/ip_plus_composition_sdxl.safetensors

works well.

but when using axel, it returns 403 forbidden.

@ismaell
Copy link
Member

ismaell commented Jun 2, 2024

Here's a trace of the communication:

--- Sending request ---
GET /ostris/ip-composition-adapter/resolve/main/ip_plus_composition_sdxl.safetensors HTTP/1.0
Host: huggingface.co
Accept: */*
Accept-Encoding: identity
Range: bytes=0-
User-Agent: Axel/2.17.14 (linux-musl)
--- End of request ---
--- Reply headers ---
HTTP/1.1 302 Found
Content-Type: text/plain; charset=utf-8
Content-Length: 1182
Connection: close
Date: Sun, 02 Jun 2024 21:34:07 GMT
X-Powered-By: huggingface-moon
cross-origin-opener-policy: same-origin
Referrer-Policy: strict-origin-when-cross-origin
X-Request-Id: Root=1-665ce54f-2ed16fe72a7015ec1b89482b
Access-Control-Allow-Origin: https://huggingface.co
Vary: Origin, Accept
Access-Control-Expose-Headers: X-Repo-Commit,X-Request-Id,X-Error-Code,X-Error-Message,X-Total-Count,ETag,Link,Accept-Ranges,Content-Range
X-Repo-Commit: 0d2ed55c441a20c20e09da4dc086097703f26b61
Accept-Ranges: bytes
X-Linked-Size: 847517960
X-Linked-ETag: "e92dc36cc273bac3200b2e41807ebdc174076185d95a45238558d4c236b6da74"
Location: https://cdn-lfs-us-1.huggingface.co/repos/61/05/61052ff9adb38d2a2a6b9771303cf11f89d1eb2af9b6b02e7a8a95b149f60c98/e92dc36cc273bac3200b2e41807ebdc174076185d95a45238558d4c236b6da74?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27ip_plus_composition_sdxl.safetensors%3B+filename%3D%22ip_plus_composition_sdxl.safetensors%22%3B&Expires=1717622606&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcxNzYyMjYwNn19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzYxLzA1LzYxMDUyZmY5YWRiMzhkMmEyYTZiOTc3MTMwM2NmMTFmODlkMWViMmFmOWI2YjAyZTdhOGE5NWIxNDlmNjBjOTgvZTkyZGMzNmNjMjczYmFjMzIwMGIyZTQxODA3ZWJkYzE3NDA3NjE4NWQ5NWE0NTIzODU1OGQ0YzIzNmI2ZGE3ND9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoifV19&Signature=lMd%7Ec5TMBw%7ECJU6Zo6bztJhbppB40A3Ecu3XIjJp6FXjNN3RdfnmwdduFUPEGjJFWe%7EVoOf-tW%7EVmEHa6dudEVlasvPBmQYPZIvdWdtLRtGA-7DFuX5jO-r1cPOFYnyMD1N7c1TtRTk6NtFkZkOUJ6BMSi7xffrWz7KeZkzAm5sPdejS5X1EvE5C7CC4VscbOQfr1RS3IaAWzcZPZgs51zUxgbNfqjlMaxh0ykFkOiJqSduR2XkZdV9NO%7EIir7N%7ErOWJaobd9ztlaoRPNgitUYga6ZNi4IDJJ7p%7Et4IhxqMejLDNOvGXIfaP4yjZTsT2ca%7ELMJCMWca2mqkflYqyvg__&Key-Pair-Id=KCD77M1F0VK2B
X-Cache: Miss from cloudfront
Via: 1.1 09b934fc5a2991212bdc3b299a0a1cb4.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: MUC50-P2
X-Amz-Cf-Id: wzyTBbO9uKT30-ajVxiLtCEEaFo4wWl2Z05D1vDw_vpdbpiafxFjUg==
--- End of headers ---
--- Sending request ---
GET /repos/61/05/61052ff9adb38d2a2a6b9771303cf11f89d1eb2af9b6b02e7a8a95b149f60c98/e92dc36cc273bac3200b2e41807ebdc174076185d95a45238558d4c236b6da74?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27ip_plus_composition_sdxl.safetensors%3B+filename%3D%22ip_plus_composition_sdxl.safetensors%22%3B&Expires=1717622606&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcxNzYyMjYwNn19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzYxLzA1LzYxMDUyZmY5YWRiMzhkMmEyYTZiOTc3MTMwM2NmMTFmODlkMWViMmFmOWI2YjAyZTdhOGE5NWIxNDlmNjBjOTgvZTkyZGMzNmNjMjczYmFjMzIwMGIyZTQxODA3ZWJkYzE3NDA3NjE4NWQ5NWE0NTIzODU1OGQ0YzIzNmI2ZGE3ND9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoifV19&Signature=lMd%7Ec5TMBw%7ECJU6Zo6bztJhbppB40A3Ecu3XIjJp6FXjNN3RdfnmwdduFUPEGjJFWe%7EVoOf-tW%7EVmEHa6dudEVlasvPBmQYPZIvdWdtLRtGA-7DFuX5jO-r1cPOFYnyMD1N7c1TtRTk6NtFkZkOUJ6BMSi7xffrWz7KeZkzAm5sPdejS5X1EvE5C7CC4VscbOQfr1RS3IaAWzcZPZgs51zUxgb HTTP/1.0
Host: cdn-lfs-us-1.huggingface.co
Accept: */*
Accept-Encoding: identity
Range: bytes=0-
User-Agent: Axel/2.17.14 (linux-musl)
--- End of request ---
--- Reply headers ---
HTTP/1.1 403 Forbidden
Server: CloudFront
Date: Sun, 02 Jun 2024 21:34:07 GMT
Content-Type: text/xml
Content-Length: 146
Connection: close
X-Cache: Error from cloudfront
Via: 1.1 89f400f550feb1d74a18ecb2070103ac.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: FRA60-P3
X-Amz-Cf-Id: ysrAOsRPsjrzBelXeRTEnfkLYDsTfwoJZNEUGaVJVxZOSVlkn5ehhA==
Vary: Origin
--- End of headers ---
ERROR 403: Forbidden.

Reproducer script:

socat - OPENSSL:cdn-lfs-us-1.huggingface.co:443 <<'EOF'
GET /repos/61/05/61052ff9adb38d2a2a6b9771303cf11f89d1eb2af9b6b02e7a8a95b149f60c98/e92dc36cc273bac3200b2e41807ebdc174076185d95a45238558d4c236b6da74?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27ip_plus_composition_sdxl.safetensors%3B+filename%3D%22ip_plus_composition_sdxl.safetensors%22%3B&Expires=1717622606&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcxNzYyMjYwNn19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzYxLzA1LzYxMDUyZmY5YWRiMzhkMmEyYTZiOTc3MTMwM2NmMTFmODlkMWViMmFmOWI2YjAyZTdhOGE5NWIxNDlmNjBjOTgvZTkyZGMzNmNjMjczYmFjMzIwMGIyZTQxODA3ZWJkYzE3NDA3NjE4NWQ5NWE0NTIzODU1OGQ0YzIzNmI2ZGE3ND9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoifV19&Signature=lMd%7Ec5TMBw%7ECJU6Zo6bztJhbppB40A3Ecu3XIjJp6FXjNN3RdfnmwdduFUPEGjJFWe%7EVoOf-tW%7EVmEHa6dudEVlasvPBmQYPZIvdWdtLRtGA-7DFuX5jO-r1cPOFYnyMD1N7c1TtRTk6NtFkZkOUJ6BMSi7xffrWz7KeZkzAm5sPdejS5X1EvE5C7CC4VscbOQfr1RS3IaAWzcZPZgs51zUxgb HTTP/1.0
Host: cdn-lfs-us-1.huggingface.co
Accept: */*
Accept-Encoding: identity
User-Agent: Axel/2.17.14 (linux-musl)

EOF

Server response

HTTP/1.1 403 Forbidden
Server: CloudFront
Date: Sun, 02 Jun 2024 22:04:41 GMT
Content-Type: text/xml
Content-Length: 146
Connection: close
X-Cache: Error from cloudfront
Via: 1.1 79272ab9b399ee696b329d4f677dca48.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: FRA60-P3
X-Amz-Cf-Id: KTfJ5hL_QjpTFrajs4x-DXlVX-LXMO6MayvOB4-mSKJU5k6GU9ihdw==
Vary: Origin

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>MissingKey</Code>
  <Message>Missing Key-Pair-Id query parameter or cookie value</Message>
</Error>

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

Successfully merging a pull request may close this issue.

2 participants