|
3 | 3 |
|
4 | 4 | // tinygo does not support net.http so this package is not needed for it |
5 | 5 | //go:build !tinygo |
6 | | -// +build !tinygo |
7 | 6 |
|
8 | 7 | package http |
9 | 8 |
|
@@ -77,7 +76,7 @@ func (i *rwInterceptor) cleanHeaders() { |
77 | 76 | // interruption is triggered, this buffer is later used to analyse the body in |
78 | 77 | // the response processor. |
79 | 78 | // If the body isn't accessible or the mime type isn't processable, the response |
80 | | -// body is being writen to the delegate response writer directly. |
| 79 | +// body is being written to the delegate response writer directly. |
81 | 80 | func (i *rwInterceptor) Write(b []byte) (int, error) { |
82 | 81 | if i.tx.IsInterrupted() { |
83 | 82 | // if there is an interruption it must be from at least phase 4 and hence |
@@ -184,15 +183,15 @@ func wrap(w http.ResponseWriter, r *http.Request, tx types.Transaction) ( |
184 | 183 | if err != nil { |
185 | 184 | i.overrideWriteHeader(http.StatusInternalServerError) |
186 | 185 | i.flushWriteHeader() |
187 | | - return fmt.Errorf("failed to release the response body reader: %v", err) |
| 186 | + return fmt.Errorf("failed to release the response body reader: %w", err) |
188 | 187 | } |
189 | 188 |
|
190 | 189 | // this is the last opportunity we have to report the resolved status code |
191 | 190 | // as next step is write into the response writer (triggering a 200 in the |
192 | 191 | // response status code.) |
193 | 192 | i.flushWriteHeader() |
194 | 193 | if _, err := io.Copy(w, reader); err != nil { |
195 | | - return fmt.Errorf("failed to copy the response body: %v", err) |
| 194 | + return fmt.Errorf("failed to copy the response body: %w", err) |
196 | 195 | } |
197 | 196 | } else { |
198 | 197 | i.flushWriteHeader() |
|
0 commit comments