| @@ -50,6 +50,17 @@ import ( · 49 unmodified lines |
| 50 | | 50 | |
| 51 | const oauthCallbackSuccessHTML = `<html><head><meta charset="utf-8"><title>Authentication successful</title><script>setTimeout(function(){window.close();},5000);</script></head><body><h1>Authentication successful!</h1><p>You can close this window.</p><p>This window will close automatically in 5 seconds.</p></body></html>` | 51 | const oauthCallbackSuccessHTML = `<html><head><meta charset="utf-8"><title>Authentication successful</title><script>setTimeout(function(){window.close();},5000);</script></head><body><h1>Authentication successful!</h1><p>You can close this window.</p><p>This window will close automatically in 5 seconds.</p></body></html>` |
| 52 | | 52 | |
| | 53 | var corsExposedResponseHeaders = []string{ |
| | 54 | "X-CPA-VERSION", |
| | 55 | "X-CPA-COMMIT", |
| | 56 | "X-CPA-BUILD-DATE", |
| | 57 | "X-CPA-SUPPORT-PLUGIN", |
| | 58 | "X-CPA-HOME-VERSION", |
| | 59 | "X-CPA-HOME-BUILD-DATE", |
| | 60 | "X-SERVER-VERSION", |
| | 61 | "X-SERVER-BUILD-DATE", |
| | 62 | } |
| | 63 | |
| 53 | type serverOptionConfig struct { | 64 | type serverOptionConfig struct { |
| 54 | extraMiddleware []gin.HandlerFunc | 65 | extraMiddleware []gin.HandlerFunc |
| 55 | engineConfigurator func(*gin.Engine) | 66 | engineConfigurator func(*gin.Engine) |
| @@ -1466,6 +1477,7 @@ func corsMiddleware() gin.HandlerFunc { · 1410 unmodified lines |
| 1466 | c.Header("Access-Control-Allow-Origin", "*") | 1477 | c.Header("Access-Control-Allow-Origin", "*") |
| 1467 | c.Header("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS") | 1478 | c.Header("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS") |
| 1468 | c.Header("Access-Control-Allow-Headers", "*") | 1479 | c.Header("Access-Control-Allow-Headers", "*") |
| | 1480 | c.Header("Access-Control-Expose-Headers", strings.Join(corsExposedResponseHeaders, ", ")) |
| 1469 | | 1481 | |
| 1470 | if c.Request.Method == "OPTIONS" { | 1482 | if c.Request.Method == "OPTIONS" { |
| 1471 | c.AbortWithStatus(http.StatusNoContent) | 1483 | c.AbortWithStatus(http.StatusNoContent) |