How can I extract the scheme, host and port to use another route in a response? #2389
Unanswered
FritsHoogland
asked this question in
Q&A
Replies: 1 comment
-
The request doesn't contain that information. In theory, the I assume you actually need this for something other than the given example, because that is trivially the same as using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I have a route that generates html that gets sent to the client, which contains a picture on the same server in another route:
The function the route is bound to is below, together with what I have been trying so far.
Currently, I have set scheme, host and port set to fixed values. However, I want it to pick up these from the client request, so that any client GET request that makes it to this route will be able to pick up the image:
The problem here is that the response is:
For which I would expect, and hope to accomplish with your help to be http://localhost:3000/img as image source.
axum version
0.7.1
Beta Was this translation helpful? Give feedback.
All reactions