Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !8966

Changed `proxyConfig.context` to return a bool when `headers.accept` is undeclared.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/kristofferaas/master into master May 06, 2020
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: kristofferaas

Hi 👋,

I had some issues with using the default proxy heuristics with my own websocket server. So I did some digging and as far as I can tell the proxyConfig.context function returns undefined if the accept header is missing.

So I added a quick test prepareProxy.test.js that uses proxyConfig.context to filter a few mocked requests to check if they get proxied (returns true to proxy, false otherwise). And sure enough when testing path name /socket/proxy without an accept header it results in undefined. I expect it to be true since since it should be proxied according to the default heuristics described in your documentation / comments.

So I changed proxyConfig.context to ensure that both the method: GET and Accept: text/html check always returns a bool, and if they're false only then calling mayProxy() for a final check!

Passes the new tests and closes #5280

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/kristofferaas/master