Summer Sale! All accounts are 50% off this week.

flssol's avatar

Adding custom headers to upload-file request

Is there a way to add headers to upload-file request? Currently I am adding tenant tag to all Livewire requests like so:

import { Livewire } from '../../../vendor/livewire/livewire/dist/livewire.esm';

Livewire.hook('request', ({ uri, options, payload, respond, succeed, fail }) => {

    var tenantTag = document.head.querySelector('meta[name="tenant"]');

    if(tenantTag) {
        options.headers['X-Tenant'] = tenantTag.content;
    }
});

But the upload mechanism is different from a "regular" LW request.

0 likes
1 reply
Michael_K's avatar

Pushing that question, because I have the same problem now.

Please or to participate in this conversation.