Skip to content

Commit 1800790

Browse files
Access-Control-Allow-Origin header added to /index* routes (#97)
* Header 'Access-Control-Allow-Origin: *' added to context within serveDevfileIndexWithType handler. * Set invoke for 'Access-Control-Allow-Origin' response header moved from serveDevfileIndexWithType to buildIndexAPIResponse for covering all /index* endpoints.
1 parent db88e58 commit 1800790

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index/server/pkg/server/endpoint.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ func buildIndexAPIResponse(c *gin.Context) {
168168
var responseIndexPath, responseBase64IndexPath string
169169
isFiltered := false
170170

171+
// Sets Access-Control-Allow-Origin response header to allow cross origin requests
172+
c.Header("Access-Control-Allow-Origin", "*")
173+
171174
// Load the appropriate index file name based on the devfile type
172175
switch indexType {
173176
case string(indexSchema.StackDevfileType):

0 commit comments

Comments
 (0)