History

fix: avoid buffering of server sent events by proxies (#10164)

Harshavardhana committed 6 years ago

Commit 25a55ba1 parent fe157165 files · +25 −13Browse files

Showing the changes to cmd/api-headers.go (1 of 5 files). Show all

Unified · Split

cmd/api-headers.go+7−0
@@ -38,6 +38,13 @@ func mustGetRequestID(t time.Time) string { · 37 unmodified lines
38 return fmt.Sprintf("%X", t.UnixNano())38 return fmt.Sprintf("%X", t.UnixNano())
39}39}
40 40
41// setEventStreamHeaders to allow proxies to avoid buffering proxy responses
42func 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// Write http common headers48// Write http common headers
42func setCommonHeaders(w http.ResponseWriter) {49func setCommonHeaders(w http.ResponseWriter) {
43 w.Header().Set(xhttp.ServerInfo, "MinIO/"+ReleaseTag)50 w.Header().Set(xhttp.ServerInfo, "MinIO/"+ReleaseTag)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t