Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common http: find a way to get the ACTUAL final URL out of undici #553

Open
josephjclark opened this issue May 8, 2024 · 1 comment
Open

Comments

@josephjclark
Copy link
Collaborator

In the new common http helpers, we build a bunch of arguments and then call out to undici:

 const response = await client.request({
    path,
    query,
    method,
    headers,
   ... etc
})

When we return the URL as part of the response, we're really only returning the base URL and path. We don't include the query string, or any other transformations that undici may choose to make.

What I'd really really love is if we can trap the actual final URL that undici calls out to (query params and all) and return THAT value as part of the response.

@josephjclark
Copy link
Collaborator Author

I had a bit of a look at this yesterday and struggled.

If we use the fetch or request functions we can add a bunch of event handlers and I suspect those will give us the full and final url and headers and stuff.

But when we call through a client, as we do, those callbacks don't seem to be available. Which is super frustrating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

1 participant