-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: Resolve CORS errors in OpenAPI tab of Playground #3263
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3263 +/- ##
===========================================
+ Coverage 77.53% 78.01% +0.48%
===========================================
Files 382 382
Lines 35263 35308 +45
===========================================
+ Hits 27341 27544 +203
+ Misses 6296 6127 -169
- Partials 1626 1637 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 58 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, sorry for this back peddling.. Your initial simple fix was the closest to the actual change we should have done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for dealing with the flip flop.
On the bright side you got exposed to the middleware system 🙂
…3263) ## Relevant issue(s) Resolves sourcenetwork#2458 ## Description There was a bug in the Playground's OpenAPI tool. This tool would list the URL of the endpoints as localhost instead of 127.0.0.1 (which is what the startup Defradb message shows.) The result was that attempting to execute one of the queries returned a CORS error. This was a one-liner fix. I adjusted openapi.go to use `http://127.0.0.1:9181/api/v0` as a string literal for the URL, instead of `http://localhost:9181/api/v0` ## Tasks - [x] I made sure the code is well commented, particularly hard-to-understand areas. - [x] I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in nts, ## How has this been tested? The platform(s) on which this was tested: - Windows
Relevant issue(s)
Resolves #2458
Description
There was a bug in the Playground's OpenAPI tool. This tool would list the URL of the endpoints as localhost instead of 127.0.0.1 (which is what the startup Defradb message shows.) The result was that attempting to execute one of the queries returned a CORS error.
This was a one-liner fix. I adjusted openapi.go to use
http://127.0.0.1:9181/api/v0
as a string literal for the URL, instead ofhttp://localhost:9181/api/v0
Tasks
How has this been tested?
The platform(s) on which this was tested: