Skip to content

Commit a9eeade

Browse files
committed
Allow mixing transformRequest.setProtocol and thenForwardTo
Previously even if you provided a bare hostname with no protocol, setProtocol was ignored. It's now used as long as no hostname is in the URL.
1 parent e2e557f commit a9eeade

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rules/requests/request-rule-builder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ export class RequestRuleBuilder extends BaseRuleBuilder {
425425
...options,
426426
transformRequest: {
427427
...options.transformRequest,
428-
setProtocol: protocol as 'http' | 'https' | undefined,
428+
...(protocol ? {
429+
setProtocol: protocol as 'http' | 'https' | undefined
430+
} : {}),
429431
replaceHost: { targetHost: host }
430432
}
431433
}));

0 commit comments

Comments
 (0)