- Notifications
You must be signed in to change notification settings - Fork8.4k
Open
Description
Bug report
Describe the bug
Using IPv6 address as server address makes things fail left and right
Steps to reproduce the behavior
- Edit 'config/server.js'
- Set host to
::1
strapi develop
andstrapi develop --watch-admin
strapi develop:
The message printed contains
Welcome back!To access the server ⚡️, go to:http://::1:1337
http://::1:1337
is an invalid address, it should behttp://[::1]:1337
strapi develop --watch-admin:
It openshttp://localhost:8080/
which eventually loads only to give the errorWarning: An error occurred while requesting the API
(why is a fatal error a warning?)
It keeps loading ad-infinitum.
Console shows
main.bundle.js:40325 DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL at dispatchXhrRequest (http://localhost:8080/admin/main.bundle.js:36835:13) at new Promise (<anonymous>) at xhrAdapter (http://localhost:8080/admin/main.bundle.js:36806:10) at dispatchRequest (http://localhost:8080/admin/main.bundle.js:37600:10)
The URL it tries to load ishttp://::1:1337/admin/project-type
. Again, improper IPv6 handling.
Expected behavior
It just works with IPv6 addresses
Screenshots
Code snippets
this is a good stopgap, no idea if that's going to break at some edge case
if(ip.indexOf(':')!=-1)ip=`[${ip}]`
System
- Node.js version: v17.3.0
- NPM version: 8.3.0
- Strapi version: 4.0.4
- Database: sqlite3
- Operating system: nixos 22.05beta
Additional context
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Reviewed