2021-10-18 12:26:33 +03:00
|
|
|
function handleRequest(request, response) {
|
|
|
|
// First item will be the ID; other items are optional
|
|
|
|
var query = request.queryString.split(/&/);
|
2012-08-28 21:10:08 +04:00
|
|
|
|
2021-10-18 12:26:33 +03:00
|
|
|
response.setHeader("Content-Type", "text/css", false);
|
2012-08-28 21:10:08 +04:00
|
|
|
|
2021-10-18 12:26:33 +03:00
|
|
|
if (query.indexOf("cors-anonymous") != -1) {
|
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*", false);
|
|
|
|
} else if (
|
|
|
|
query.indexOf("cors-credentials") != -1 &&
|
|
|
|
request.hasHeader("Origin")
|
|
|
|
) {
|
|
|
|
response.setHeader(
|
|
|
|
"Access-Control-Allow-Origin",
|
|
|
|
request.getHeader("Origin"),
|
|
|
|
false
|
|
|
|
);
|
|
|
|
response.setHeader("Access-Control-Allow-Credentials", "true", false);
|
|
|
|
}
|
2012-08-28 21:10:08 +04:00
|
|
|
|
2021-10-18 12:26:33 +03:00
|
|
|
response.write(
|
|
|
|
"#" +
|
|
|
|
query[0] +
|
|
|
|
" { color: green !important }" +
|
|
|
|
"\n" +
|
|
|
|
"#" +
|
|
|
|
query[0] +
|
|
|
|
".reverse { color: red !important }"
|
|
|
|
);
|
2012-08-28 21:10:08 +04:00
|
|
|
}
|