Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

CustomHeaders not set on delete feature #1661

@danielebriggi

Description

@danielebriggi

Type of issue

Bug

Uploader type

Azure

Bug details

Fine Uploader version

5.11.7

Browsers where the bug is reproducible

Any

Operating systems where the bug is reproducible

Any

Exact steps required to reproduce the issue

Setup the plugin for working with Azure Storage.
Use a SAS endpoint that requires an header to respond properly (eg, Authorization: Bearer ..)
Upload a file and then try to delete it.

All of your Fine Uploader initialization JavaScript code

var uploader = new qq.azure.FineUploader({
        element: document.getElementById('uploader'),
        deleteFile: {
            enabled: true
        },
        request: {
            endpoint: 'https://...'
        },
        signature: {
            endpoint: 'http://...',
            customHeaders: {
                Authorization: 'Bearer ' + getApiToken()
            }
        }
});

Detailed explanation of the problem

customHeaders are not set on delete function.
My endpoint that provides the SAS uri requires the Authorization header to respond properly.
In case of upload the process works because the header is set.
In case of delete the customHeaders are not set and so the retrieving the SAS uri fails.

I think the bug is here https://github.com/FineUploader/fine-uploader/blob/master/client/js/azure/uploader.basic.js#L195 and can be resolved in this way
https://github.com/danielebriggi/fine-uploader/blob/fix-missing-customHeaders-on-delete/client/js/azure/uploader.basic.js#L195

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions