kopia lustrzana https://gitlab.com/rysiekpl/libresilient
error plugin can now into headers
rodzic
c1b84cac86
commit
2406bca941
|
@ -23,6 +23,8 @@
|
||||||
type: "http",
|
type: "http",
|
||||||
// only valid if type: http
|
// only valid if type: http
|
||||||
code: 500,
|
code: 500,
|
||||||
|
// valid only if type: http
|
||||||
|
headers: {},
|
||||||
// valid either way
|
// valid either way
|
||||||
message: "Internal server error"
|
message: "Internal server error"
|
||||||
}
|
}
|
||||||
|
@ -43,14 +45,17 @@
|
||||||
LR.log(pluginName, `erroring out for: ${url} — HTTP error`)
|
LR.log(pluginName, `erroring out for: ${url} — HTTP error`)
|
||||||
|
|
||||||
// I guess we want a HTTP error then
|
// I guess we want a HTTP error then
|
||||||
|
|
||||||
var responseInit = {
|
var responseInit = {
|
||||||
status: config.code,
|
status: config.code,
|
||||||
statusText: config.message,
|
statusText: config.message,
|
||||||
headers: {},
|
headers: config.headers,
|
||||||
url: url
|
url: url
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// we need some content type here
|
||||||
|
if (responseInit.headers['Content-Type'] === undefined) {
|
||||||
responseInit.headers['Content-Type'] = "text/plain"
|
responseInit.headers['Content-Type'] = "text/plain"
|
||||||
|
}
|
||||||
|
|
||||||
let blob = new Blob(
|
let blob = new Blob(
|
||||||
[config.message],
|
[config.message],
|
||||||
|
|
Ładowanie…
Reference in New Issue