-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add option to set Accept header #282
Conversation
Thanks for the contribution! How did you test this? I can see two things to pay attention to with this change. First, the extension of the file is based on the input URL or an extra request to determine it. The same logic also apply for the content-length which is determine by a HEAD request before hand. WDYT? |
Good insights! For testing, I simply hard-coded To answer the questions:
Background: I originally conceived of this modification when I noticed a discrepancy between browser responses and what For my own use-case, I leave dlm in the background and only check after a few hours to see if it finished, usually it's pulling a large number of files concurrently. |
Thanks for the detailed answer 👍
I propose you try to send the extra header for all requests. Maybe the code needs some refactoring to have less parameters passed around, some kind of request builder abstraction? Glad to hear |
Added a small change to send After mulling this over, I think you're right that some request builder abstraction would be a good idea. Some set of headers could be configured by the user up front, and that information passed around the codebase. It might be more work than it's worth for your use-case or mine, but that does seem like a useful idea. |
Thanks for the contribution 👍 I will take of the refactoring and extra testing 🤖 |
This PR adds an option to set the
Accept
header explicitly in the client. This is useful in the case that the server can hand back a better format e.g.WebP
instead of JPEG, and the client simply has to let the server know.