Enable configuring CORS to remove same-domain requirement#266
Conversation
| googleAnalyticsId: '{{.Values.ui.googleAnalyticsId}}', | ||
| appName: '{{.Values.ui.appName}}', | ||
| {{- if .Values.ui.backendHostname }} | ||
| backendHostname: '{{ .Values.ui.backendHostname }}', |
There was a problem hiding this comment.
I decided not to make the default /api to not change the way it currently work, but maybe that makes sense?
There was a problem hiding this comment.
I think it makes sense to remove it because we can use a subdomain like api.mydomain.com. Adding /api may be repetitive. However, I think this is not so important now and it's a different issue.
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
+ Coverage 90.14% 90.33% +0.18%
==========================================
Files 18 18
Lines 944 962 +18
==========================================
+ Hits 851 869 +18
Misses 62 62
Partials 31 31
Continue to review full report at Codecov.
|
| googleAnalyticsId: '{{.Values.ui.googleAnalyticsId}}', | ||
| appName: '{{.Values.ui.appName}}', | ||
| {{- if .Values.ui.backendHostname }} | ||
| backendHostname: '{{ .Values.ui.backendHostname }}', |
There was a problem hiding this comment.
I think it makes sense to remove it because we can use a subdomain like api.mydomain.com. Adding /api may be repetitive. However, I think this is not so important now and it's a different issue.
| # source: my-repository-source | ||
| cors: | ||
| allowed_origins: | ||
| - my-api-server |
There was a problem hiding this comment.
I see this is a configurable parameter. Can you add some documentation? I'm not sure if the frontend will work with this default configuration.
There was a problem hiding this comment.
This is the default in https://github.com/helm/monocular/blob/master/src/api/config/cors/cors.go#L30, I just copied it here. It means that only a hostname of my-api-server or same-origin will work. A blank value would allow all origins, I believe.
There was a problem hiding this comment.
You're right 👍. Thanks for the explanation
fixes #235