Skip to content

Tiny Error in Promise<FileResponse> responses #5308

@Demiurg-ls

Description

@Demiurg-ls

After last update the suport for Promise has [re]appeared ...
Although there is tiny type mismatch causing a typescript error:

... protected processFileGet(response: Response): Promise<FileResponse> { ... let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined ... return response.blob().then((blob) => { return { fileName: fileName, data: blob, status: status, headers: _headers }

Thy type of variable fileName: string | undefined

is beening set to

FileResponse.fileName? of type "string" - error appears
FileResponse.fileName? should probably have type "string | undefined"

Best regards,
Łukasz

P.S. Your software is a great support, thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions