mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
2982bfa483
--HG-- rename : toolkit/webapps/tests/test_hosted.xul => toolkit/webapps/tests/test_hosted_launch.xul rename : toolkit/webapps/tests/test_packaged.xul => toolkit/webapps/tests/test_packaged_launch.xul
34 lines
667 B
JavaScript
34 lines
667 B
JavaScript
function getQuery(request) {
|
|
let query = {};
|
|
|
|
request.queryString.split('&').forEach(function(val) {
|
|
let [name, value] = val.split('=');
|
|
query[name] = unescape(value);
|
|
});
|
|
|
|
return query;
|
|
}
|
|
|
|
function handleRequest(request, response) {
|
|
response.setHeader("Cache-Control", "no-cache", false);
|
|
|
|
let query = getQuery(request);
|
|
|
|
if ("appreq" in query) {
|
|
response.setHeader("Content-Type", "text/plain", false);
|
|
response.write("Hello world!");
|
|
|
|
setState("appreq", "done");
|
|
|
|
return;
|
|
}
|
|
|
|
if ("testreq" in query) {
|
|
response.setHeader("Content-Type", "text/plain", false);
|
|
|
|
response.write(getState("appreq"));
|
|
|
|
return;
|
|
}
|
|
}
|