mirror of
https://github.com/flyimg/flyimg.git
synced 2026-04-25 09:45:50 +03:00
[GH-ISSUE #357] forward authorization headers from client request to origin server request #757
Labels
No labels
Docs
Docs
Docs
Security
UnitTest
bug
dependencies
duplicate
enhancement
enhancement
enhancement
hacktoberfest
help wanted
invalid
pull-request
question
stale
version 1
version 2
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flyimg#757
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lorello on GitHub (Sep 21, 2023).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/357
Hi guys,
we are using flyimg in a sort of ticket system. Users can add screenshots or photos to their tickets, these files are private, to access them we need to supply a Bearer token to the original image server. We'd like to use flyimg to serve smaller preview of these attachments, but currently flyimg doesn't pass original authorization request headers to the origin server that hosts attachments, is this a interesting feature that we could add? If yes, we could send a PR.
We could add an option like extra_header_options, could be:
original_headers_whitelistthat list all the headers that from the client request must be forwarded to the origin request.This option should be used in saveToTemporaryFile method
What do you think?
@sadok-f commented on GitHub (Sep 21, 2023):
Hi @lorello ,
Thank you for opening up this issue!
It's a great idea, would be great if you could submit a PR!
maybe the option would be a bool variable, called
forward_request_headersdefault to false and when it is set to true it forwards all client headers to the origin image url.@lorello commented on GitHub (Sep 22, 2023):
hi @sadok-f
as you can see my collegue @lrealdi has already implemented it and we are testing in our QA environment
we cannot pass all the headers from client to origin, if we forward the
Host:header the call obviously fails :-(For this reason we opted for an array of headers
@sadok-f commented on GitHub (Sep 22, 2023):
Sorry @lorello, I didn't get it in the first comment.
Now I got it, yes makes sense what you propose.
please have a look at the PR's failed pipeline, there are a couple of small warnings regarding code listing and complexity.
would be great if you could add one unit test if possible.
Thank you!