Allow custom HTTP headers
This commit is contained in:
parent
e35dac1137
commit
8958f47462
@ -74,6 +74,7 @@ const initSettings = (initialSettings, config) => {
|
||||
userAgent: '',
|
||||
referer: '',
|
||||
http_proxy: '',
|
||||
headers: '',
|
||||
...settings.http,
|
||||
};
|
||||
|
||||
@ -293,6 +294,15 @@ const createInputs = (settings, config, skills) => {
|
||||
input.options.push('-referer', settings.http.referer);
|
||||
}
|
||||
|
||||
if (settings.http.headers.length !== 0) {
|
||||
let headers = settings.http.headers
|
||||
.split('\n')
|
||||
.map((l) => l.trim())
|
||||
.filter((l) => l.length > 0)
|
||||
.join('\r\n');
|
||||
input.options.push('-headers', headers + '\r\n');
|
||||
}
|
||||
|
||||
if (settings.http.http_proxy.length !== 0) {
|
||||
input.options.push('-http_proxy', settings.http.http_proxy);
|
||||
}
|
||||
@ -605,6 +615,19 @@ function AdvancedSettings({ settings = {}, onChange = function (settings) {} })
|
||||
onChange={onChange('http', 'referer')}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<TextField
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
multiline
|
||||
label="Headers"
|
||||
value={settings.http.headers}
|
||||
onChange={onChange('http', 'headers')}
|
||||
/>
|
||||
<Typography variant="caption">
|
||||
<Trans>List of additional HTTP headers, one per line.</Trans>
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<TextField
|
||||
variant="outlined"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user