Skip to content

Playground forces https on all requests #1426

Open
@WaisKamal

Description

@WaisKamal

This issue pertains to the following package(s):

  • GraphQL Playground - Electron App
  • GraphQL Playground HTML
  • GraphQL Playground
  • GraphQL Playground Express Middleware
  • GraphQL Playground Hapi Middleware
  • GraphQL Playground Koa Middleware
  • GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

Windows 11 21H2

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

The one that is bundled with GraphQL 16.8.1

What is the expected behavior?

The issue occurs when using the playground with a GraphQL API that is:

  1. not hosted on localhost, and
  2. served over http rather than https

For example, if the playground is loaded via http://192.168.8.102:8539/graphql, all query requests should be going to the same URL.

What is the actual behavior?

The playground insists on sending the query requests on the same URL but via https. For example, in the above case, the requests go to https://192.168.8.102:8539/graphql. This can be observed in the browser's devtools in the network tab.

What steps may we take to reproduce the behavior?

  1. Set up a GraphQL server
  2. Navigate to the playground hosted by the server via localhost and make a query
  3. Now navigate to the playground via the server's IP address (remote or local, doesn't matter) and make a query

The first query works while the second fails. The two images below show the failed request (the first shows the request URL, the second shows the request body).

Please provide a gif or image of the issue for a quicker response/fix.
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions