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,
|
||||
settingSendCookies: renderedRequest.settingSendCookies,
|
||||
settingStoreCookies: renderedRequest.settingStoreCookies,
|
||||
settingRebuildPath: renderedRequest.settingRebuildPath,
|
||||
type: renderedRequest.type,
|
||||
url: renderedRequest.url
|
||||
}
|
||||
|
@ -61,7 +61,8 @@ type BaseRequest = {
|
||||
settingStoreCookies: boolean,
|
||||
settingSendCookies: boolean,
|
||||
settingDisableRenderRequestBody: boolean,
|
||||
settingEncodeUrl: boolean
|
||||
settingEncodeUrl: boolean,
|
||||
settingRebuildPath: boolean
|
||||
};
|
||||
|
||||
export type Request = BaseModel & BaseRequest;
|
||||
@ -83,7 +84,8 @@ export function init (): BaseRequest {
|
||||
settingStoreCookies: true,
|
||||
settingSendCookies: true,
|
||||
settingDisableRenderRequestBody: false,
|
||||
settingEncodeUrl: true
|
||||
settingEncodeUrl: true,
|
||||
settingRebuildPath: true
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,11 @@ export async function _actuallySend (
|
||||
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
|
||||
// See https://curl.haxx.se/libcurl/c/CURLOPT_CUSTOMREQUEST.html
|
||||
switch (renderedRequest.method.toUpperCase()) {
|
||||
|
@ -162,6 +162,16 @@ class RequestSettingsModal extends PureComponent {
|
||||
</HelpTooltip>
|
||||
</label>
|
||||
</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>
|
||||
);
|
||||
|
@ -25,6 +25,7 @@ declare class Curl {
|
||||
NOPROGRESS: number,
|
||||
NOPROXY: number,
|
||||
PASSWORD: number,
|
||||
PATH_AS_IS: number,
|
||||
POST: number,
|
||||
POSTFIELDS: number,
|
||||
PROXY: number,
|
||||
|
Loading…
Reference in New Issue
Block a user