Skip to content

Commit 8021633

Browse files
committed
fix: Relax Content-Type Checks in Integration Tests
When checking response `Content-Type` during integration tests, relaxed all media-type values to regex.
1 parent fd99081 commit 8021633

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

test/integration/formats-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ describe('formats', function () {
112112
it('Accept text/plain', function (done) {
113113
server.get('/put-input.txt')
114114
.set('accept', 'text/plain')
115-
.expect('Content-type', 'text/plain')
115+
.expect('Content-type', /text\/plain/)
116116
.expect(200, done)
117117
})
118118
it('Accept text/turtle', function (done) {
119119
server.get('/put-input.txt')
120120
.set('accept', 'text/turtle')
121-
.expect('Content-type', 'text/plain; charset=utf-8')
121+
.expect('Content-type', /text\/plain/)
122122
.expect(406, done)
123123
})
124124
})

test/integration/http-test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe('HTTP APIs', function () {
349349
it('should return resource link for files', function (done) {
350350
server.get('/hello.html')
351351
.expect('Link', /<http:\/\/www.w3.org\/ns\/ldp#Resource>; rel="type"/)
352-
.expect('Content-Type', 'text/html')
352+
.expect('Content-Type', /text\/html/)
353353
.expect(200, done)
354354
})
355355
it('should have glob support', function (done) {
@@ -460,30 +460,30 @@ describe('HTTP APIs', function () {
460460
describe('HEAD API', function () {
461461
it('should return content-type application/octet-stream by default', function (done) {
462462
server.head('/sampleContainer/blank')
463-
.expect('Content-Type', 'application/octet-stream; charset=utf-8')
463+
.expect('Content-Type', /application\/octet-stream/)
464464
.end(done)
465465
})
466466
it('should return content-type text/turtle for container', function (done) {
467467
server.head('/sampleContainer2/')
468-
.expect('Content-Type', 'text/turtle; charset=utf-8')
468+
.expect('Content-Type', /text\/turtle/)
469469
.end(done)
470470
})
471471
it('should have set content-type for turtle files',
472472
function (done) {
473473
server.head('/sampleContainer2/example1.ttl')
474-
.expect('Content-Type', 'text/turtle; charset=utf-8')
474+
.expect('Content-Type', /text\/turtle/)
475475
.end(done)
476476
})
477477
it('should have set content-type for implicit turtle files',
478478
function (done) {
479479
server.head('/sampleContainer/example4')
480-
.expect('Content-Type', 'text/turtle; charset=utf-8')
480+
.expect('Content-Type', /text\/turtle/)
481481
.end(done)
482482
})
483483
it('should have set content-type for image files',
484484
function (done) {
485485
server.head('/sampleContainer/solid.png')
486-
.expect('Content-Type', 'image/png; charset=utf-8')
486+
.expect('Content-Type', /image\/png/)
487487
.end(done)
488488
})
489489
it('should have Access-Control-Allow-Origin as Origin', function (done) {
@@ -517,7 +517,7 @@ describe('HTTP APIs', function () {
517517
it('should have set Content-Type as text/turtle for Container',
518518
function (done) {
519519
server.head('/sampleContainer2/')
520-
.expect('Content-Type', 'text/turtle; charset=utf-8')
520+
.expect('Content-Type', /text\/turtle/)
521521
.expect(200, done)
522522
})
523523
it('should have set Link as Container/BasicContainer',

0 commit comments

Comments
 (0)