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 Andrew Bastin
parent 5632334c9a
commit 2ee8614b93
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))