mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Setting for Curl's PATH_AS_IS flag (Closes #823)
This commit is contained in:
parent
cbd873febc
commit
87ccc34bad
@ -291,6 +291,7 @@ export async function getRenderedRequestAndContext (
|
|||||||
settingEncodeUrl: renderedRequest.settingEncodeUrl,
|
settingEncodeUrl: renderedRequest.settingEncodeUrl,
|
||||||
settingSendCookies: renderedRequest.settingSendCookies,
|
settingSendCookies: renderedRequest.settingSendCookies,
|
||||||
settingStoreCookies: renderedRequest.settingStoreCookies,
|
settingStoreCookies: renderedRequest.settingStoreCookies,
|
||||||
|
settingRebuildPath: renderedRequest.settingRebuildPath,
|
||||||
type: renderedRequest.type,
|
type: renderedRequest.type,
|
||||||
url: renderedRequest.url
|
url: renderedRequest.url
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,8 @@ type BaseRequest = {
|
|||||||
settingStoreCookies: boolean,
|
settingStoreCookies: boolean,
|
||||||
settingSendCookies: boolean,
|
settingSendCookies: boolean,
|
||||||
settingDisableRenderRequestBody: boolean,
|
settingDisableRenderRequestBody: boolean,
|
||||||
settingEncodeUrl: boolean
|
settingEncodeUrl: boolean,
|
||||||
|
settingRebuildPath: boolean
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Request = BaseModel & BaseRequest;
|
export type Request = BaseModel & BaseRequest;
|
||||||
@ -83,7 +84,8 @@ export function init (): BaseRequest {
|
|||||||
settingStoreCookies: true,
|
settingStoreCookies: true,
|
||||||
settingSendCookies: true,
|
settingSendCookies: true,
|
||||||
settingDisableRenderRequestBody: false,
|
settingDisableRenderRequestBody: false,
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true,
|
||||||
|
settingRebuildPath: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +157,11 @@ export async function _actuallySend (
|
|||||||
setOpt(Curl.option.MAXREDIRS, settings.maxRedirects);
|
setOpt(Curl.option.MAXREDIRS, settings.maxRedirects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't rebuild dot sequences in path
|
||||||
|
if (!renderedRequest.settingRebuildPath) {
|
||||||
|
setOpt(Curl.option.PATH_AS_IS, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Only set CURLOPT_CUSTOMREQUEST if not HEAD or GET. This is because Curl
|
// Only set CURLOPT_CUSTOMREQUEST if not HEAD or GET. This is because Curl
|
||||||
// See https://curl.haxx.se/libcurl/c/CURLOPT_CUSTOMREQUEST.html
|
// See https://curl.haxx.se/libcurl/c/CURLOPT_CUSTOMREQUEST.html
|
||||||
switch (renderedRequest.method.toUpperCase()) {
|
switch (renderedRequest.method.toUpperCase()) {
|
||||||
|
@ -162,6 +162,16 @@ class RequestSettingsModal extends PureComponent {
|
|||||||
</HelpTooltip>
|
</HelpTooltip>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="form-control form-control--thin">
|
||||||
|
<label>Rebuild path dot sequences
|
||||||
|
<HelpTooltip position="top" className="space-left">
|
||||||
|
This instructs libcurl to squash sequences of "/../" or "/./" that may exist in
|
||||||
|
the URL's path part and that is supposed to be removed according to RFC 3986
|
||||||
|
section 5.2.4
|
||||||
|
</HelpTooltip>
|
||||||
|
{this.renderCheckboxInput('settingRebuildPath')}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -25,6 +25,7 @@ declare class Curl {
|
|||||||
NOPROGRESS: number,
|
NOPROGRESS: number,
|
||||||
NOPROXY: number,
|
NOPROXY: number,
|
||||||
PASSWORD: number,
|
PASSWORD: number,
|
||||||
|
PATH_AS_IS: number,
|
||||||
POST: number,
|
POST: number,
|
||||||
POSTFIELDS: number,
|
POSTFIELDS: number,
|
||||||
PROXY: number,
|
PROXY: number,
|
||||||
|
Loading…
Reference in New Issue
Block a user