Skip to content

Commit

Permalink
fix content type in graphql request
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Dec 8, 2023
1 parent 733bcb7 commit f422a5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function queryToDataFile(dataSource: IDataSourceModel, queryStr: string, options
const method = s2s ? s2s.method : dataSource.get('method')
const headers = s2s ? s2s.headers : dataSource.get('headers')
// Check that the content-type is set
if(headers && !headers['content-type']) {
if(headers && !Object.keys(headers).find(key => key.toLowerCase() === 'content-type')) {
console.warn('11ty plugin for Silex: no content-type in headers of the graphql query. I will set it to application/json for you. To avoid this warning, add a header with key "content-type" and value "application/json" in silex config.')
headers['content-type'] = 'application/json'
}
Expand Down

0 comments on commit f422a5b

Please sign in to comment.