Skip to content

@std/http/file-server shouldn't print network (non-loopback) address when host is loopback-only #5558

Open
@jsejcksn

Description

@jsejcksn

Describe the bug

Steps to Reproduce

Run the file server with permission --allow-sys=networkInterfaces and set the --host to a loopback value (e.g. localhost, 127.0.0.1, etc.).

deno run --allow-net=localhost --allow-read --allow-sys=networkInterfaces jsr:@std/http/file-server --host=localhost

Expected behavior

The onListen event handler should not print a network (non-loopback) address in the informational output — because it will not be reachable:

Listening on:
- Local: http://127.0.0.1:8000

Observed behavior

Non-loopback addresses are printed and represented as reachable:

Listening on:
- Local: http://127.0.0.1:8000
- Network: http://10.0.1.100:8000

Environment

  • OS: macOS 14.5
  • deno version: 1.45.4
  • std version: 2024.07.26

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghttp

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions