Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Accept header to 'application/json' for GraphQL queries #7312

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

pkukielka
Copy link
Contributor

Changes

This PR fixes setting Accept header to 'application/json' which is required by some proxies to work.

Test plan

Tested with a local reverse proxy.

Prerequisites (YOUR_TOKEN is a token configured for your user at YOUR_INSTANCE):

  1. Right cody_setting.json configuration:
{
  "cody.override.serverEndpoint":  "https://localhost:443",

  "cody.auth.externalProviders": [
    {
      "endpoint": "https://localhost:443",
      "executable": {
        "commandLine": ["echo '{ \"headers\": { \"Authorization\": \"token YOUR_TOKEN\" } }'"],
        "shell": "/bin/bash"
      }
    },
  1. Proxy running in the console: mitmproxy -m reverse:https://YOUR_INSTANCE/ -p 443

Then you can start cody, and in the proxy console you should be able to inspect one of the graphql requests and see something like this:

image

@pkukielka pkukielka merged commit d669832 into main Mar 4, 2025
21 of 22 checks passed
@pkukielka pkukielka deleted the pkukielka/set-accept-header branch March 4, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants