Add content-type header to file_server (denoland/deno_std#47)

Original: ab27371a01
This commit is contained in:
Bartek Iwańczuk 2018-12-31 10:06:06 +01:00 committed by Ryan Dahl
parent 95e378a28b
commit b65727734e
3 changed files with 93 additions and 0 deletions

View file

@ -25,6 +25,7 @@ export function runTests(serverReadyPromise: Promise<any>) {
const res = await fetch("http://localhost:4500/.travis.yml");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEqual(res.headers.get("content-type"), "text/yaml");
const downloadedFile = await res.text();
const localFile = new TextDecoder().decode(await readFile("./.travis.yml"));
assertEqual(downloadedFile, localFile);