Skip to content

[feature] Request hostname and host #4682

@Worldwidebrine

Description

@Worldwidebrine

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

https://nodejs.org/api/url.html#urlhost
https://nodejs.org/api/url.html#urlhostname

The key difference between url.host and url.hostname is that url.hostname does not include the port.

Motivation

Currently, req.hostname is example.com:1234

Example

req.hostname // example.com
req.host // example.com:1234

Metadata

Metadata

Assignees

No one assigned

    Labels

    semver-majorIssue or PR that should land as semver major

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions