Skip to content
Myr

fix(validator): support json api header (#2855)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Balint Orosz · committed by GitHub · parent 0735e0c · Browse files · 2 files+14 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−1 removed

  • tests:+13 added−0 removed
  • other:+1 added−1 removed

2 files+14 added−1 removed

modified:src/validator/validator.test.ts+13 added
128 unmodified lines
129 })130 expect(res.status).toBe(200)131 })132133 it('Should return 200 response, for request with JSON:API Content-Type application/vnd.api+json', async () => {134 const res = await app.request('http://localhost/post', {135 method: 'POST',136 headers: {137 'Content-Type': 'application/vnd.api+json',138 },139 body: JSON.stringify({140 any: 'thing',141 }),142 })143 expect(res.status).toBe(200)144 })145146 it('Should return 400 response, if Content-Type header does not start with application/json', async () => {147 const res = await app.request('http://localhost/post', {148 method: 'POST',149 headers: {
889 unmodified lines
modified:src/validator/validator.ts+1 added-1 removed