feat: add debug log control and optimize error response and cors log
- add DebugLog global variable controlled by BYTEDANCE_TTS_DEBUG env - enable debug logs for cors, tts upstream, response parsing etc when debug mode is on - update tts error response to use standardized json error format - add dashboard and metrics path to cache-control exempt list
This commit is contained in:
@@ -12,7 +12,7 @@ func SecurityHeaders(next http.Handler) http.Handler {
|
||||
w.Header().Set("X-XSS-Protection", "1; mode=block")
|
||||
w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin")
|
||||
|
||||
if strings.HasPrefix(r.URL.Path, "/v1/") || r.URL.Path == "/health" {
|
||||
if strings.HasPrefix(r.URL.Path, "/v1/") || r.URL.Path == "/health" || r.URL.Path == "/dashboard" || r.URL.Path == "/metrics" {
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user