Commit b8b3c4b
committed
Guard valid content type check against bad Content-Type
Avoid `undefined method 'start_with?' for nil:NilClass` in
`Rack::MediaType` `strip_doublequotes` when given a bad content type.
Given:
Clients MUST send all JSON:API data in request documents with the header
Content-Type: application/vnd.api+json without any media type
parameters.
Clients MUST ignore any parameters for the application/vnd.api+json
media type received in the Content-Type header of response documents.
We can just check if the content type == `application/vnd.api+json`.1 parent d59b6b1 commit b8b3c4b
File tree
2 files changed
+9
-1
lines changed- lib/jsonapi/rails
- spec
2 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
0 commit comments