Skip to content

fix: missing HTTP status check in downloadClientFromRelease and downloadTypesFromRelease #409

@Hazelnut46

Description

@Hazelnut46

Bug

downloadClientFromRelease() and downloadTypesFromRelease() in downloader.js don't check the HTTP status code before writing to file.

If the server returns 404 or any other error, the response body (usually an HTML error page) gets written to the client/types file and the function still resolves as success.

downloadBinariesFromRelease() in the same file already handles this correctly with a status check and .on('error') handler. These two functions should behave the same way.

Fix

Add status code check and .on('error') handler to both downloadClientFromRelease() and downloadTypesFromRelease().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions