Skip to content

getRequestURL function not working properly #952

Open
@catfishlty

Description

@catfishlty

Environment

  • NodeJS: v23.5.0
  • "nuxt": "^3.15.0",
  • "vue": "latest",
  • "h3": "^1.13.0"

Reproduction

API

export default defineEventHandler(async (event) => {
  const url = getRequestURL(event);
  console.log(url)
  return ""
});

Call Url: http://localhost:30301/api/v1/system

URL { href: 'http://localhost/api/v1/system',
  origin: 'http://localhost',
  protocol: 'http:',
  username: '',
  password: '',
  host: 'localhost',
  hostname: 'localhost',
  port: '',
  pathname: '/api/v1/system',
  search: '',
  searchParams: URLSearchParams {},
  hash: '' }

Describe the bug

The value of url.host should be localhost:30301 instead of localhost.
So I think getRequestURL function is not working correctly.
Could you like help me check it?

Additional context

No response

Logs

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions