fix: return contenttype header value string with parameters

This commit is contained in:
Thomas Dupont
2022-07-05 13:06:18 +02:00
committed by Joachim Van Herwegen
parent e0954cf2a7
commit 311f8756ec
12 changed files with 122 additions and 30 deletions

View File

@@ -10,6 +10,7 @@ const baseUrl = `http://localhost:${port}`;
const documents = [
[ '/turtle', 'text/turtle', '# Test' ],
[ '/markdown', 'text/markdown', '# Test' ],
[ '/plain', 'text/plain; charset=utf-8', '# Test' ],
];
const cases: [string, string, string][] = [
@@ -27,6 +28,8 @@ const cases: [string, string, string][] = [
[ '/markdown', 'text/html', 'text/html,*/*;q=0.8' ],
[ '/markdown', 'text/html', 'text/markdown;q=0.1, text/html;q=0.9' ],
[ '/markdown', 'application/octet-stream', 'application/octet-stream' ],
[ '/plain', 'text/plain; charset=utf-8', 'text/plain' ],
[ '/plain', 'text/plain; charset=utf-8', 'text/plain;q=0.1, text/markdown;q=0.9' ],
];
describe('Content negotiation', (): void => {