Skip to content

Commit fc3a5ad

Browse files
committed
Ensure no request data is persisted server-side
Also document options more clearly. Previously Mockttp stored data for access via rule.getSeenRequests(), which isn't necessary. Now, we delegate all persistence to the UI (as we should've been doing all along).
1 parent 786d10b commit fc3a5ad

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ export async function runHTK(options: {
8181
// Start a Mockttp standalone server
8282
const standalone = getStandalone({
8383
serverDefaults: {
84-
cors: false,
85-
https: httpsConfig
84+
cors: false, // Don't add mocked CORS responses to intercepted traffic
85+
recordTraffic: false, // Don't persist traffic here (keep it in the UI)
86+
https: httpsConfig // Use our HTTPS config for HTTPS MITMs.
8687
},
8788
corsOptions: {
88-
strict: true,
89-
origin: ALLOWED_ORIGINS,
90-
maxAge: 86400 // Cache this result for as long as possible
89+
strict: true, // For the standalone admin API, require valid CORS headers
90+
origin: ALLOWED_ORIGINS, // Only allow requests from our origins, to avoid XSRF
91+
maxAge: 86400 // Cache CORS responses for as long as possible
9192
}
9293
});
9394
standalone.start({

0 commit comments

Comments
 (0)