question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Petstore no longer honouring explicit HTTPS scheme, and using HTTP instead?

See original GitHub issue

From @alzadude on April 11, 2017 13:37

A recent change to the Petstore seems to have broken the explicit HTTPS api call behaviour.

Steps to reproduce:

  1. Go to http://petstore.swagger.io
  2. Enter swagger url for the api, using HTTPS (e.g. for one of our api calls, use https://imin-platform-api.imin.co/v1/swagger.json)
  3. Specify scheme HTTPS
  4. Enter required api parameters (e.g. for one of our api calls, use GET /v1/search/sessions)
  5. Click Execute

Expected: Petstore executes api call using HTTPS as specified.

Actual: Petstore appears to execute api call using HTTP (which for our api, doesn’t work unfortunately), and Swagger then shows TypeError: NetworkError when attempting to fetch resource.

Would someone be able to investigate this issue to determine why making the HTTPS scheme explicit isn’t working, and why HTTP is being used instead?

Thanks 😃

Copied from original issue: swagger-api/swagger-core#2171

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
shockeycommented, Apr 19, 2017

Latest master doesn’t exhibit this problem (very likely that #2927 fixed it).

Getting a CORS error with this spec:

Fetch API cannot load https://imin-platform-api.imin.co/v1/search/sessions?lat=111&lng=111&radius=111. Response for preflight has invalid HTTP status code 404.

We’re requesting with https, so this looks fixed.

@alzadude, this will be included in our Friday release. If you see any lingering problems, please reply here and I’ll look into it.

Closing!

0reactions
r4mbo7commented, Mar 18, 2019

Solving it by enabling CORS on the aiohttp server side (using aiohttp_cors)

self.webapp = aiohttp.web.Application()
self.webapp.add_routes(routes)
# Add CORS header for the swagger UI
cors = aiohttp_cors.setup(self.webapp, defaults={
    "*": aiohttp_cors.ResourceOptions(
        allow_credentials=True,
        expose_headers="*",
        allow_headers="*",
    )
})
# Configure CORS on all routes.
for route in list(self.webapp.router.routes()):
    cors.add(route)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Petstore no longer honouring explicit HTTPS scheme, and ...
A recent change to the Petstore seems to have broken the explicit HTTPS api call behaviour. Steps to reproduce:.
Read more >
swagger ui - petstore URL not disabled in SpringDoc OpenAPi
It just seems like Swagger is keeping a cache or something, but saving a configured OAS_3 seems to let Swagger know to stop...
Read more >
Release Notes | Learn UIlicious - What is UI-licious
Switching away from the Editor tab in large projects with many files is now much quicker and should no longer result in the...
Read more >
rcouch - Read the Docs
https scheme instead of the http. Actually, it's a synonym for X-Forwarded-Proto: https header, but used by some reverse proxies: [httpd].
Read more >
Untitled - Squarespace
use a common property regime, but that regime does not constitute the commons. Common (noun). While some traditionalists use the term “the common”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found