Showing the changes to cmd/api-headers.go (1 of 5 files). Show all
Unified · Split
| @@ -38,6 +38,13 @@ func mustGetRequestID(t time.Time) string { · 37 unmodified lines | ||
| 38 | 38 | return fmt.Sprintf("%X", t.UnixNano()) |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | +// setEventStreamHeaders to allow proxies to avoid buffering proxy responses | |
| 42 | +func setEventStreamHeaders(w http.ResponseWriter) { | |
| 43 | + w.Header().Set(xhttp.ContentType, "text/event-stream") | |
| 44 | + w.Header().Set(xhttp.CacheControl, "no-cache") // nginx to turn off buffering | |
| 45 | + w.Header().Set("X-Accel-Buffering", "no") // nginx to turn off buffering | |
| 46 | +} | |
| 47 | + | |
| 41 | 48 | // Write http common headers |
| 42 | 49 | func setCommonHeaders(w http.ResponseWriter) { |
| 43 | 50 | w.Header().Set(xhttp.ServerInfo, "MinIO/"+ReleaseTag) |