hgouveia / node-downloader-helper

A simple http file downloader for node.js
MIT License
247 stars 54 forks source link

The path drops all GET params #83

Closed milkliker closed 2 years ago

milkliker commented 2 years ago

https://github.com/hgouveia/node-downloader-helper/blob/30b3dfec11c9ab45abd62c25cb6d00e03a982634/src/index.js#L845

    __getOptions(method, url, headers = {}) {
        const urlParse = new URL(url);
        const options = {
            protocol: urlParse.protocol,
            host: urlParse.hostname,
            port: urlParse.port,
            path: urlParse.pathname, // <--- I think this should be:  urlParse.pathname + urlParse.search
            method: method
        };

        if (headers) {
            options['headers'] = headers;
        }

        return options;
    }
milkliker commented 2 years ago

Oh sorry, duplicate with #82

hgouveia commented 2 years ago

Implemented on v2.1.0