Conversation
|
Thank you for your PR. Has there been any AI involved in this PR? |
|
Only when I was trying to figure out why the reverse proxy config in my Caddyfile wasn't working and the generated url used the internal hostname. |
|
Thank you for the quick response :) I would prefer not to add If an API call requires the http.Request, you can add it to it's struct, which can for example been seen here: Gokapi/internal/webserver/api/routing.go Lines 343 to 350 in 5c1c147 |
|
Gotcha, another option was to route the X-Forwarded-For value in the context and wire the context through the API.
Which one do you prefer? i can update the PR after work today. |
|
I think the best way would be to include the *http.Request and pass it to the new function that returns the server URL. The default url can be retrieved with |
|
i think i kinda did what you asked, added the http.request to the params structs, didn't need to update any parsing code (it needs codegen that i wasn't sure of anyway). |
|
Let me know if you want any other change or if you want to implement it yourself |
|
Thanks, I will probably modify the PR a bit next week, unfortunately I don't have a lot of time in the coming days. |
I run gokapi behind a Caddy server using reverse proxy as well as on my local network. Both setups have different hostnames and currently Gokapi only supports using one "public hostname" which leads to one endpoint failing to download (downloadPresigned uses the configured url).
This changes add support for respecting the X-Forwarded-* headers to respond with the appropriate hostname and fixes the issue.