Skip to content

Commit 76ed6a8

Browse files
authored
chore(gatsby-source-drupal): Document fix for 406 (#35927)
Document in the README how to use a custom header from `gatsby-config.js` to specify a media type for Drupal JSON API. This can fix `406 Not Acceptable` errors.
1 parent be21c15 commit 76ed6a8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/gatsby-source-drupal/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,26 @@ module.exports = {
230230
}
231231
```
232232

233+
One case where custom headers can be useful is if your webserver returns a `406 Not Acceptable` response.
234+
This happens when it requires narrow conformance with the JSON:API MIME type (e.g. Apache2 with security
235+
module enabled).
236+
237+
```javascript
238+
module.exports = {
239+
plugins: [
240+
{
241+
resolve: `gatsby-source-drupal`,
242+
options: {
243+
// ...
244+
headers: {
245+
accept: "application/vnd.api+json",
246+
},
247+
},
248+
},
249+
],
250+
}
251+
```
252+
233253
## GET Search Params
234254

235255
You can append optional GET request params to the request url using `params` option.

0 commit comments

Comments
 (0)