Skip to content

File uploads are broken on latest Firefox Nightly #949

@k80w

Description

@k80w

Under the latest version of Firefox Nightly, upon uploading a file, the following text is always uploaded in place of the files real contents

function stream() {
    [native code]
}

This seems to be caused by http-api.js:70:

const body = file.stream ? file.stream : file;

On other browsers, File.stream will be undefined; however, Firefox Nightly now adheres to the latest draft of the File API which defines a .stream() method, meaning this line is swapping the content of the file for this stream method and later stringifying and uploading that method.

The original purpose of this line seems to be to keep compatibility with older code, which was supposedly encouraged to set file.stream to the stream to be uploaded. I'm not sure if this is still necessary, especially considering this is apparently undocumented behavior. Deleting this line entirely solves the issue.

If it is necessary to keep compatibility, we could just ensure the file isn't a File before checking for file.stream.

This may be the same issue as #908, as the description of that issue sounds similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Z-Community-PRIssue is solved by a community member's PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions