1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/tests/robocop_dynamic.sjs Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,18 @@ 1.4 +/** 1.5 + * Dynamically generated page whose title matches the given id. 1.6 + */ 1.7 + 1.8 +function handleRequest(request, response) { 1.9 + let id = request.queryString.match(/^id=(.*)$/)[1]; 1.10 + let key = "dynamic." + id; 1.11 + 1.12 + response.setStatusLine(request.httpVersion, 200, null); 1.13 + response.setHeader("Content-Type", "text/html", false); 1.14 + response.setHeader("Cache-Control", "no-cache", false); 1.15 + response.write('<html>'); 1.16 + response.write('<head><title>' + id + '</title><meta charset="utf-8"></head>'); 1.17 + response.write('<body>'); 1.18 + response.write('<h1>' + id + '</h1>'); 1.19 + response.write('</body>'); 1.20 + response.write('</html>'); 1.21 +}