Skip to content

Commit

Permalink
fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
kataras committed Dec 5, 2019
1 parent 057f081 commit ee2fdec
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div align="center">
<!-- Release -->
<a href="https://github.com/kataras/muxie/releases">
<img src="https://img.shields.io/badge/release%20-v1.0.7-0077b3.svg?style=flat-squaree"
<img src="https://img.shields.io/badge/release%20-v1.0.8-0077b3.svg?style=flat-squaree"
alt="Release/stability" />
</a>
<!-- Godocs -->
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Source code and other details for the project are available at GitHub:
Current Version
1.0.7
1.0.8
Installation
The only requirement is the Go Programming Language
$ go get -u github.com/kataras/muxie
$ go get github.com/kataras/muxie
Examples
Expand Down
22 changes: 22 additions & 0 deletions params_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,25 @@ func (pw *paramsWriter) reset(w http.ResponseWriter) {
pw.ResponseWriter = w
pw.params = pw.params[0:0]
}

// Flusher indicates if `Flush` is supported by the client.
//
// The default HTTP/1.x and HTTP/2 ResponseWriter implementations
// support Flusher, but ResponseWriter wrappers may not. Handlers
// should always test for this ability at runtime.
//
// Note that even for ResponseWriters that support Flush,
// if the client is connected through an HTTP proxy,
// the buffered data may not reach the client until the response
// completes.
func (pw *paramsWriter) Flusher() (http.Flusher, bool) {
flusher, canFlush := pw.ResponseWriter.(http.Flusher)
return flusher, canFlush
}

// Flush sends any buffered data to the client.
func (pw *paramsWriter) Flush() {
if flusher, ok := pw.Flusher(); ok {
flusher.Flush()
}
}

0 comments on commit ee2fdec

Please sign in to comment.