Commit 746a007
fix(rest): throw on binary content-type with normalizable schema in auto-detection path
When content is not set and parseResponse auto-detects a binary
content-type, response.blob() was returned immediately without any
schema validation. An endpoint with a normalizable schema (e.g.,
schema: Article) that unexpectedly receives a binary content-type like
application/octet-stream would silently return a Blob to the
normalizer instead of throwing a descriptive error.
Add the same schema compatibility check that exists for the explicit
content property path and the text response path, so binary
auto-detection now throws a NetworkError with status 400 when a
normalizable schema is present.
Co-authored-by: Nathaniel Tucker <me@ntucker.me>1 parent 7b14dc4 commit 746a007
2 files changed
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
178 | 190 | | |
179 | 191 | | |
180 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1955 | 1955 | | |
1956 | 1956 | | |
1957 | 1957 | | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
1958 | 1977 | | |
1959 | 1978 | | |
1960 | 1979 | | |
| |||
0 commit comments