You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated my ActiveStorage::BaseController on my Rails API to require authentication details specific to our implementation. This seems to work fine for GET requests for an uploaded file, as well as for the Blob being POSTed during the upload, but then there seems to be a PUT request, which I assume is the actual file being uploaded, which fails because it doesn't have the custom header I provided to DirectUploadProvider.
The text was updated successfully, but these errors were encountered:
While I still believe that the headers prop should provide the storage request with the same headers, I seemingly fixed this issue by passing the onBeforeStorageRequest prop and modifying the request like this:
onBeforeStorageRequest={({ id, file, xhr })=>{xhr.setRequestHeader('APIKey',/* My API Key */);xhr.setRequestHeader('UserToken',/* My User Token */);}}
I updated my ActiveStorage::BaseController on my Rails API to require authentication details specific to our implementation. This seems to work fine for GET requests for an uploaded file, as well as for the Blob being POSTed during the upload, but then there seems to be a PUT request, which I assume is the actual file being uploaded, which fails because it doesn't have the custom header I provided to DirectUploadProvider.
The text was updated successfully, but these errors were encountered: