Skip to content

Commit

Permalink
ingest: cors: allow x-ip-policy header
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Oct 7, 2024
1 parent 0d4987e commit bf7c83c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ingest/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ func (r *Router) CorsMiddleware(c *gin.Context) {
if c.Request.Method == "OPTIONS" {
c.Header("Access-Control-Allow-Origin", utils.NvlString(origin, "*"))
c.Header("Access-Control-Allow-Methods", "GET,POST,HEAD,OPTIONS")
c.Header("Access-Control-Allow-Headers", "x-enable-debug, x-write-key, authorization, content-type")
c.Header("Access-Control-Allow-Headers", "x-enable-debug, x-write-key, authorization, content-type, x-ip-policy")
c.Header("Access-Control-Allow-Credentials", "true")
c.Header("Access-Control-Max-Age", "86400")
c.AbortWithStatus(http.StatusOK)
return
} else if origin != "" {
c.Header("Access-Control-Allow-Origin", origin)
c.Header("Access-Control-Allow-Methods", "GET,POST,HEAD,OPTIONS")
c.Header("Access-Control-Allow-Headers", "x-enable-debug, x-write-key, authorization, content-type")
c.Header("Access-Control-Allow-Headers", "x-enable-debug, x-write-key, authorization, content-type, x-ip-policy")
c.Header("Access-Control-Allow-Credentials", "true")
c.Header("Access-Control-Max-Age", "86400")
}
Expand Down
4 changes: 2 additions & 2 deletions sync-sidecar/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const (
upsertSpecSQL = `INSERT INTO source_spec as s (package, version, specs, timestamp, error ) VALUES ($1, $2, $3, $4, $5)
ON CONFLICT ON CONSTRAINT source_spec_pkey DO UPDATE SET specs = $3, timestamp = $4, error=$5 where s.specs is null`

insertSpecErrorSQL = `INSERT INTO source_spec (package, version, timestamp, error ) VALUES ($1, $2, $3, $4)
ON CONFLICT ON CONSTRAINT source_spec_pkey DO NOTHING`
insertSpecErrorSQL = `INSERT INTO source_spec as s (package, version, timestamp, error ) VALUES ($1, $2, $3, $4)
ON CONFLICT ON CONSTRAINT source_spec_pkey DO UPDATE SET timestamp = $3, error=$4 where s.specs is null`

upsertCatalogStatusSQL = `INSERT INTO source_catalog (package, version, key, timestamp, status, description) VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT ON CONSTRAINT source_catalog_pkey DO UPDATE SET timestamp = $4, status=$5, description=$6`
Expand Down

0 comments on commit bf7c83c

Please sign in to comment.