mirror of
https://github.com/Kong/insomnia.git
synced 2026-01-29 08:13:06 -05:00
Reconcile secureReadFile changes with reverted mock response extractor changes
This commit is contained in:
@@ -140,7 +140,7 @@ If you want to create a self-hosted mock server route from a request response in
|
||||
label: 'Name',
|
||||
onComplete: async name => {
|
||||
invariant(activeResponse, 'Active response must be defined');
|
||||
const body = 'bodyPath' in activeResponse ? await fs.readFile(activeResponse.bodyPath) : '';
|
||||
const body = 'bodyPath' in activeResponse ? await window.main.secureReadFile({ path: activeResponse.bodyPath }) : '';
|
||||
// auth mechanism is too sensitive to allow content length checks
|
||||
const headersWithoutContentLength: ResponseHeader[] = activeResponse.headers.filter(
|
||||
h => h.name.toLowerCase() !== 'content-length',
|
||||
@@ -171,7 +171,7 @@ If you want to create a self-hosted mock server route from a request response in
|
||||
label: 'Name',
|
||||
onComplete: async name => {
|
||||
invariant(activeResponse, 'Active response must be defined');
|
||||
const body = 'bodyPath' in activeResponse ? await fs.readFile(activeResponse.bodyPath) : '';
|
||||
const body = 'bodyPath' in activeResponse ? await window.main.secureReadFile({ path: activeResponse.bodyPath }) : '';
|
||||
const hasRouteInServer = mockServerAndRoutes
|
||||
.find(s => s._id === selectedMockServer)
|
||||
?.routes.find(r => r.name === name && r.method.toUpperCase() === 'GET');
|
||||
|
||||
Reference in New Issue
Block a user