mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
js: Only load URLs prefixed by the base URL
This commit is contained in:
parent
484bd26d63
commit
aad020511f
@ -242,6 +242,10 @@
|
|||||||
loadUrl: function (url, $target, data, method, action, autorefresh, progressTimer, extraHeaders) {
|
loadUrl: function (url, $target, data, method, action, autorefresh, progressTimer, extraHeaders) {
|
||||||
var id = null;
|
var id = null;
|
||||||
|
|
||||||
|
if (url.startsWith('//') || ! url.startsWith(this.baseUrl + '/')) {
|
||||||
|
throw new Error('URL ' + url + ' is not relative to ' + this.baseUrl);
|
||||||
|
}
|
||||||
|
|
||||||
// Default method is GET
|
// Default method is GET
|
||||||
if ('undefined' === typeof method) {
|
if ('undefined' === typeof method) {
|
||||||
method = 'GET';
|
method = 'GET';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user