Skip to content

Commit 44a9cff

Browse files
committed
Add a server workaround for httptoolkit/httptoolkit-ui@1ea3aa1a
1 parent 9941160 commit 44a9cff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/api/rest-api.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as _ from 'lodash';
12
import type {
23
Application as ExpressApp,
34
NextFunction
@@ -70,7 +71,12 @@ export function exposeRestAPI(
7071
const proxyPort = parseInt(req.params.proxyPort, 10);
7172
if (isNaN(proxyPort)) throw new StatusError(400, `Could not parse required proxy port: ${req.params.proxyPort}`);
7273

73-
const interceptorOptions = req.body || undefined;
74+
let interceptorOptions = req.body;
75+
76+
if (_.isEmpty(interceptorOptions) && !_.isEmpty(req.query)) {
77+
// TEMPORARY (drop by August 2023) fix for UI bug that briefly passed options wrong
78+
interceptorOptions = req.query;
79+
}
7480

7581
const result = await apiModel.activateInterceptor(interceptorId, proxyPort, interceptorOptions);
7682
res.send({ result });

0 commit comments

Comments
 (0)