-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug]: HTTP urls do not support query parameters and do not support extensionless URLs #5929
Labels
Comments
This comment has been minimized.
This comment has been minimized.
yarnbot
added
reproducible
This issue can be successfully reproduced
and removed
unreproducible
This issue cannot be reproduced on master
labels
Nov 3, 2023
This issue reproduces on master:
|
Duplicate of #2437, although this other thread is closed. We probably should improve the situation somehow. |
Will be fixed with #5931 |
arcanis
added a commit
that referenced
this issue
Nov 3, 2023
**What's the problem this PR addresses?** The v2 never supported referencing packages exposed as extensionless tgz tarballs, despite other clients being fine with them. Us being stricter here doesn't provide any value, and just hurts compatibility. Fixes #5929 **How did you fix it?** Adds support for extensionless urls, which are now interpreted as regular tarballs. **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Self-service
Describe the bug
I am trying to add this tgz as a dependency: https://gitpkg.now.sh/acornjs/acorn/acorn?c3ec7023f08bdd6c4eee0bf76bfa2e0b88af8e4a
However, Yarn throws an error:
I also tried to remove the query parameter, and it still throws:
For the case without the query parameter, I can add
#.tgz
at the end of the URL. This is meaningless (it's just a URL hash that the server ignores), but it makes Yarn happy: https://gitpkg.now.sh/acornjs/acorn/acorn#.tgzHowever, this hack does not work when there is a query parameter (https://gitpkg.now.sh/acornjs/acorn/acorn?c3ec7023f08bdd6c4eee0bf76bfa2e0b88af8e4a#.tgz).
To reproduce
Environment
Additional context
Regardless of the query parameter, URLs extensions are meaningless. I could serve a JS file at
http://example.com/foo.tar
, or a tarball athttp://example.com/foo.js
. On the web, the file type is described by the mime type in the HTTP response and not by the "extension".The text was updated successfully, but these errors were encountered: