Respect URL Get variables

This commit is contained in:
Aune 2023-01-30 13:47:45 +01:00 committed by GitHub
parent 61ec923ad9
commit 90789c3c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -380,14 +380,23 @@ function get_wrapper_version(link_mode, hash) {
xhttp.withCredentials = true;
var url_current = window.location.toString();
var last_char = url_current.charAt(window.location.length-1);
if(last_char == "/") {
var init_url = window.location
if(window.location.includes("?") {
url_array = window.location.split("?")
init_url = url_array[0]
} else {
var init_url = window.location + "/"
init_url = window.location
}
xhttp.open("post", init_url + "api/get/wrapperr-version");
var last_char = url_current.charAt(init_url.length-1);
if(last_char == "/") {
var final_url = init_url
} else {
var final_url = init_url + "/"
}
xhttp.open("post", final_url + "api/get/wrapperr-version");
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhttp.send();