Skip to content

Commit

Permalink
chore(gatsby-source-drupal): Document fix for 406 (#35927)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
febeling committed Jun 14, 2022
1 parent be21c15 commit 76ed6a8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/gatsby-source-drupal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,26 @@ module.exports = {
}
```

One case where custom headers can be useful is if your webserver returns a `406 Not Acceptable` response.
This happens when it requires narrow conformance with the JSON:API MIME type (e.g. Apache2 with security
module enabled).

```javascript
module.exports = {
plugins: [
{
resolve: `gatsby-source-drupal`,
options: {
// ...
headers: {
accept: "application/vnd.api+json",
},
},
},
],
}
```

## GET Search Params

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

0 comments on commit 76ed6a8

Please sign in to comment.