-
Notifications
You must be signed in to change notification settings - Fork 39
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
Headers passed to ActiveStorageProvider don't make it to DirectUploadProvider #22
Comments
Thanks for opening this issue. You’re right that the documentation isn’t clear on this. That was the desired behavior; Can you provide a little more detail about your use case? Are you using a custom direct uploads controller? What headers are you hoping to pass through? |
We're just trying to authenticate with our |
ActiveStorage does depend on the CSRF token, which Since you’re not using Rails to serve the SPA, I see why you’re looking for another way to authenticate the uploads. I think the approach you’re considering is reasonable, and probably how most in your situation will do it. I’m going to test with my vanilla ActiveStorage setup just to make sure unnecessary headers won’t cause any problems, then I’ll change this library to pass the headers as you’ve suggested. |
Released as v0.8.0 |
Wow, thank you so much! |
I've been passing a
headers
prop toActiveStorageProvider
, but the request todirect_upload
doesn't have those headers. When I put a breakpoint inaddHeaders
inUpload.js
,this.options.headers
isundefined
- but when I put that breakpoint inActiveStorageProvider
'srender
method inindex.js
,headers
has the correct value when it's destructured on line 51 - it's just not passed down or used anywhere. Is this the desired behavior? The documentation is not clear.The text was updated successfully, but these errors were encountered: