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

Broken access from IPv6 #1808

Closed
inetol opened this issue Aug 15, 2024 · 3 comments
Closed

Broken access from IPv6 #1808

inetol opened this issue Aug 15, 2024 · 3 comments
Labels

Comments

@inetol
Copy link
Contributor

inetol commented Aug 15, 2024

Description

IPv6 access does not seem to work in specific scenarios...

589 |   if (!host)
590 |     return ret;
591 |   const [hostname, ...rest] = host.split(":");
592 |   ret.hostname = hostname;
593 |   if (rest.length > 0) {
594 |     assert(rest.length === 1, url);
          ^
error: [vike@0.4.184][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error. A maintainer will fix the bug (usually under 24 hours). Debug info (for Vike maintainers; you can ignore this): http://[::1]:3000/
      at parseHost (/dist/server/index.mjs:594:5)
      at parseUrl (/dist/server/index.mjs:892:16)
      at hasSuffix (/dist/server/index.mjs:42921:42)
      at handlePageContextRequestUrl (/dist/server/index.mjs:42915:8)
      at checkBaseUrl (/dist/server/index.mjs:43638:50)
      at /dist/server/index.mjs:43310:37
GET - / failed

I was not able to replicate the issue in a clean environment (scaffolding with Bati), but I can replicate it in a specific repository (Bun required):

  1. Clone this repo:
    1. git clone https://github.com/jspaste/frontend.git issueIP6
    1. cd issueIP6/
    1. git reset --hard dcaa09e1aa3be05993d73e12b19292b1d122f21b
  1. Install deps: bun i
  2. Build the frontend: bun vite build
  3. Run the server: NODE_ENV=production bun run --cwd=./dist/ ./server/index.mjs
  4. Access to localhost IPv6: http://[::1]:3000
@brillout
Copy link
Member

Can you publish a minimal reproduction?

@inetol
Copy link
Contributor Author

inetol commented Aug 16, 2024

https://github.com/inetol/vikejs-vike-1808 ; I was able to reproduce it as well using Hono

@brillout
Copy link
Member

Fix pre-released as 0.4.184-commit-7048cc1. I tried against your reproduction and it now works.

Btw. would your company be up for sponsoring (#1350)? It makes a massive difference to us!

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

No branches or pull requests

2 participants