Skip to content

Commit

Permalink
Merge pull request #2 from thomas4019/master
Browse files Browse the repository at this point in the history
gzip middleware now strips encoding header
  • Loading branch information
mholt committed Apr 27, 2015
2 parents a837bb6 + dbef6c7 commit c33a49f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions middleware/fastcgi/fastcgi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ package fastcgi

import (
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -105,11 +103,11 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
}
w.WriteHeader(resp.StatusCode)

body, err := ioutil.ReadAll(resp.Body)
fmt.Printf("%s", body)
fmt.Printf("%d\n", resp.StatusCode)
fmt.Printf("%d\n", len(body))
w.Write(body)
// Write the response body
_, err = io.Copy(w, resp.Body)
if err != nil {
return http.StatusBadGateway, err
}

return resp.StatusCode, nil
}
Expand Down

0 comments on commit c33a49f

Please sign in to comment.