You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix SSE GET panic on HTTP-only backends by adding an http-streaming-only mode that returns HTTP 405
* Implemented Copilot’s feedback:
- isSSEGetRequest now strips media type parameters before matching, so headers like text/event-stream; charset=utf-8 or with q-values are handled.
- Expanded TestProxyRouter_HTTPStreamingOnlyRejectsSSE to cover parameterized Accept headers, multiple values, q-values, and to ensure POST + Accept: text/event-stream still passes through to the backend.
* Improve SSE rejection messaging and coverage
* add more test coverage
|`--proxy-bearer-token`|`PROXY_BEARER_TOKEN`| - | Bearer token to add to Authorization header when proxying requests |
123
123
|`--proxy-headers`|`PROXY_HEADERS`| - | Comma-separated list of headers to add when proxying requests (format: Header1:Value1,Header2:Value2) |
124
+
|`--http-streaming-only`|`HTTP_STREAMING_ONLY`|`false`| Reject SSE (GET) requests and keep the backend operating in HTTP streaming-only mode |
124
125
|`--trusted-proxies`|`TRUSTED_PROXIES`| - | Comma-separated list of trusted proxies (IP addresses or CIDR ranges) |
125
126
126
127
For practical configuration examples including environment variables, Docker Compose, and Kubernetes deployments, see the [Configuration Examples](./examples.md) page.
rootCmd.Flags().StringVar(&proxyBearerToken, "proxy-bearer-token", getEnvWithDefault("PROXY_BEARER_TOKEN", ""), "Bearer token to add to Authorization header when proxying requests")
262
309
rootCmd.Flags().StringVar(&trustedProxies, "trusted-proxies", getEnvWithDefault("TRUSTED_PROXIES", ""), "Comma-separated list of trusted proxies (IP addresses or CIDR ranges)")
263
310
rootCmd.Flags().StringVar(&proxyHeaders, "proxy-headers", getEnvWithDefault("PROXY_HEADERS", ""), "Comma-separated list of headers to add when proxying requests (format: Header1:Value1,Header2:Value2)")
311
+
rootCmd.Flags().BoolVar(&httpStreamingOnly, "http-streaming-only", getEnvBoolWithDefault("HTTP_STREAMING_ONLY", false), "Reject SSE (GET) requests and keep the backend in HTTP streaming-only mode")
c.AbortWithStatusJSON(http.StatusMethodNotAllowed, gin.H{"error": "SSE (GET) streaming is not supported by this backend; use POST-based HTTP streaming instead"})
0 commit comments