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

fix(conf): some bugs related to package path parsing #487

Merged
merged 1 commit into from
Jan 7, 2023

Conversation

ahuigo
Copy link
Contributor

@ahuigo ahuigo commented Jan 5, 2023

./config.json:

  "basePath": "/",
  "npmRegistry": "https://registry.npmjs.org",

Bad Cases:

$ curl -D- http://localhost:8080/react
HTTP/1.1 302 Found
...
Location: //react

$ curl -D- http://localhost:8080/react@18.2.0
HTTP/1.1 302 Found
...
Location: http://localhost:8080//react@18.2.0

$ curl -D- http://localhost:8080/react
----server error------------
Get "https://registry.npmjs.orgreact": dial tcp: lookup registry.npmjs.orgreact: no such host

config.json:
```
  "basePath": "/",
  "npmRegistry": "https://registry.npmjs.org",
```

Bad Cases:
```
$ curl -D- http://localhost:8080/react
HTTP/1.1 302 Found
...
Location: //react

$ curl -D- http://localhost:8080/react@18.2.0
HTTP/1.1 302 Found
...
Location: http://localhost:8080//react@18.2.0

$ curl -D- http://localhost:8080/react
----server error------------
Get "https://registry.npmjs.orgreact": dial tcp: lookup registry.npmjs.orgreact: no such host
```
Copy link
Member

@ije ije left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look great to me, thanks~

@ije ije merged commit 3a58a57 into esm-dev:main Jan 7, 2023
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.

2 participants