(b []byte)
| 180 | } |
| 181 | |
| 182 | func (w *limitedWriter) Write(b []byte) (n int, err error) { |
| 183 | // Always write full data to actual response (don't truncate client response) |
| 184 | n, err = w.response.Write(b) |
| 185 | if err != nil { |
| 186 | return n, err |
| 187 | } |
| 188 | |
| 189 | // Write to dump buffer only up to limit |
| 190 | if w.dumped < w.limit { |
| 191 | remaining := w.limit - w.dumped |
| 192 | toDump := min(int64(n), remaining) |
| 193 | w.dumpBuf.Write(b[:toDump]) |
| 194 | w.dumped += toDump |
| 195 | } |
| 196 | |
| 197 | return n, nil |
| 198 | } |
no outgoing calls