Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Strapi doesn't work with IPv6 addresses properly #12285

Open
Labels
flag: EEIssues correlates to internal EE ticketissue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:strapiSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members
@mkg20001

Description

@mkg20001

Bug report

Describe the bug

Using IPv6 address as server address makes things fail left and right

Steps to reproduce the behavior

  1. Edit 'config/server.js'
  2. Set host to::1
  3. 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

image

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

No one assigned

    Labels

    flag: EEIssues correlates to internal EE ticketissue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:strapiSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    • Status

      Reviewed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp