Support X-Remote-User in web UI

This commit is contained in:
Max Berger
2026-03-22 15:56:04 +01:00
parent 8178b11e9e
commit 07685c292f
6 changed files with 261 additions and 46 deletions

View File

@@ -30,4 +30,21 @@ export function to_error_message(request) {
}
return request.status + " " + request.statusText;
}
/**
* @param {string} method
* @param {string} url
* @param {?string} user
* @param {?string} password
* @returns {XMLHttpRequest}
*/
export function create_request(method, url, user, password) {
let request = new XMLHttpRequest();
if (user !== null && password !== null) {
request.open(method, url, true, user, encodeURIComponent(password));
} else {
request.open(method, url, true);
}
return request;
}