mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-13 22:51:08 -05:00
Merge pull request #2 from thomas4019/master
gzip middleware now strips encoding header
This commit is contained in:
commit
c33a49fc5e
1 changed files with 5 additions and 7 deletions
|
@ -5,9 +5,7 @@ package fastcgi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -105,11 +103,11 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
||||||
}
|
}
|
||||||
w.WriteHeader(resp.StatusCode)
|
w.WriteHeader(resp.StatusCode)
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
// Write the response body
|
||||||
fmt.Printf("%s", body)
|
_, err = io.Copy(w, resp.Body)
|
||||||
fmt.Printf("%d\n", resp.StatusCode)
|
if err != nil {
|
||||||
fmt.Printf("%d\n", len(body))
|
return http.StatusBadGateway, err
|
||||||
w.Write(body)
|
}
|
||||||
|
|
||||||
return resp.StatusCode, nil
|
return resp.StatusCode, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue