mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
85e3790c93
getHeader() throws an exception if the header doesn't exist. The checks for hasHeader() below should prevent this exception from being raised.
10 lines
300 B
JavaScript
10 lines
300 B
JavaScript
function handleRequest(request, response) {
|
|
response.setStatusLine(request.httpVersion, 200, "OK");
|
|
var header = "no WhatToVary header";
|
|
if (request.hasHeader("WhatToVary")) {
|
|
header = request.getHeader("WhatToVary");
|
|
response.setHeader("Vary", header);
|
|
}
|
|
response.write(header);
|
|
}
|