fix: use --location param for url when parsing curl (#3152)

This commit is contained in:
Akash K
2023-06-22 23:40:09 +05:30
committed by GitHub
parent 878ec833ce
commit 2afc87847d
3 changed files with 7 additions and 12 deletions

View File

@@ -71,9 +71,11 @@ const parseURL = (urlText: string | number) =>
* @returns URL object
*/
export function getURLObject(parsedArguments: parser.Arguments) {
const location = parsedArguments.location ?? undefined
return pipe(
// contains raw url strings
parsedArguments._.slice(1),
[...parsedArguments._.slice(1), location],
A.findFirstMap(parseURL),
// no url found
O.getOrElse(() => new URL(defaultRESTReq.endpoint))