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

url field of the request is not set on the service side #1028

Closed
findmyway opened this issue Mar 28, 2023 · 3 comments
Closed

url field of the request is not set on the service side #1028

findmyway opened this issue Mar 28, 2023 · 3 comments

Comments

@findmyway
Copy link

findmyway commented Mar 28, 2023

MWE:

using HTTP
function handle(req)
    HTTP.Response(200, string(req.url))
end

router = HTTP.Router()
HTTP.register!(router, "/", handle)
server = HTTP.serve!(router, "127.0.0.1", 8122)

HTTP.get("http://127.0.0.1:8122") # empty result
@schlichtanders
Copy link

Hi Jun, I also stumbled upon this, concretely in Pluto - when adding query params to the url, they don't appear in the url but in the req.target field. I guess it is related to your MWE.

At least this means the documentation is wrong, it states url::URI, the full URI of the request, or it is a bug.

This looks crucial - @quinnj can you take a look?

@findmyway
Copy link
Author

url = URI(req.target)

Indeed, it's also used in the source code.

@bjarthur
Copy link

dup of #1041 ?

@quinnj quinnj closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants