-
Notifications
You must be signed in to change notification settings - Fork 244
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
Adding the ability to specify headers for a URL based attachment #498
Comments
hi - I'd be reluctant to change anything with the photo.image = Dragonfly.app.fetch_url("https://www.goo...", headers: {"Authorization"=> "Bearer <TOKEN>"}) The only thing missing that isn't currently implemented is the second arg with |
Thanks @markevans, that makes a lot of sense. I've created a PR for this. Fairly simple. Let me know if there's anything to fix :) |
I've tested this approach in my app now and it works well. |
Hi @markevans, I hope all is going well in the leadup to Christmas :)
I'm looking to download files from Google Drive via dragonfly. They'll be specified by the user using the Google Drive file picker tool that returns a
file_id
andoauth_token
. I can send these back to the server and have Dragonfly download the file from there. The trouble is that to download the file, the oauth token needs to be specified in a header:See: https://developers.google.com/drive/api/v3/manage-downloads
I've had a look at the code and it appears specifying extra headers isn't currently supported. Would you be interested in having this as a feature? or do you think there's another way to do this?
I guess the biggest challenge would be working out a tidy way to pass in the extra headers. Perhaps passing a hash to the assignment method that contains say:
would work? I'd be keen to get onto this asap, so if you had any ideas or pointers before I begin that would be really helpful :)
The text was updated successfully, but these errors were encountered: