Skip to content

Commit

Permalink
add narrower Accept: application/json header to outgoing HTTP requests
Browse files Browse the repository at this point in the history
For customers whose Sourcegraph instance is proxied by a custom proxy that expects this header for API requests.
  • Loading branch information
sqs committed Jan 16, 2025
1 parent 6a721b5 commit 762eee1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/shared/src/sourcegraph-api/graphql/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ export class SourcegraphGraphQLAPIClient {
})())

const headers = new Headers(config.configuration?.customHeaders as HeadersInit | undefined)
headers.set('Accept', 'application/json')
headers.set('Content-Type', 'application/json; charset=utf-8')
if (config.clientState.anonymousUserID && !process.env.CODY_WEB_DONT_SET_SOME_HEADERS) {
headers.set('X-Sourcegraph-Actor-Anonymous-UID', config.clientState.anonymousUserID)
Expand Down

0 comments on commit 762eee1

Please sign in to comment.