func scrubRequest(req *heat.Request) error { // Only ever send HTTP/1.1 requests. req.Major = 1 req.Minor = 1 // Work out the request body size. size, err := heat.RequestBodySize(req) if err != nil { return err } scrubHeaderFields(&req.Fields, size) return nil }
// readRequest reads an HTTP request. func readRequest(r xo.Reader) (*heat.Request, *bodyReader, error) { req, err := heat.ReadRequestHeader(r) if err != nil { return nil, nil, err } size, err := heat.RequestBodySize(req) if err != nil { return nil, nil, err } var body *bodyReader if size != 0 { r, _ := heat.OpenBody(r, size) body = &bodyReader{r: r} req.Body = body } return req, body, nil }