Skip to content

Commit 8e2081d

Browse files
committed
Limit graphql server to localhost & *.httptoolkit.tech with CORS
1 parent 3c943e1 commit 8e2081d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/httptoolkit-server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ export class HttpToolkitServer extends events.EventEmitter {
149149
// Hacky solution that lets us limit the server to only localhost,
150150
// and override the port from 4000 to something less likely to conflict.
151151
port: { port: 45457, host: 'localhost' },
152-
playground: false
152+
playground: false,
153+
cors: {
154+
origin: [/https?:\/\/localhost(:\d+)?$/, /\.httptoolkit\.tech$/]
155+
}
153156
});
154157
}
155158
};

0 commit comments

Comments
 (0)