Skip to content
Snippets Groups Projects
Commit 3bef6dcc authored by Natalie Weizenbaum's avatar Natalie Weizenbaum
Browse files

Fix chrome_test for shelf 0.6.0.

R=kevmoo@google.com

Review URL: https://codereview.chromium.org//1053923002
parent c67bd5b6
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,13 @@ void main() {
var javaScript;
var servePage = (request) {
if (request.url.path == "/") {
var path = request.url.path;
// We support both shelf 0.5.x and 0.6.x. The former has a leading "/"
// here, the latter does not.
if (path.startsWith("/")) path = path.substring(1);
if (path.isEmpty) {
return new shelf.Response.ok("""
<!doctype html>
<html>
......@@ -30,7 +36,7 @@ void main() {
</head>
</html>
""", headers: {'content-type': 'text/html'});
} else if (request.url.path == "/index.js") {
} else if (path == "index.js") {
return new shelf.Response.ok(javaScript,
headers: {'content-type': 'application/javascript'});
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment