(c *ApiController, response *pipepkg.WebhookResponse)
| 162 | } |
| 163 | |
| 164 | func writePipeWebhookResponse(c *ApiController, response *pipepkg.WebhookResponse) { |
| 165 | if response == nil { |
| 166 | c.Ctx.ResponseWriter.WriteHeader(http.StatusOK) |
| 167 | return |
| 168 | } |
| 169 | |
| 170 | if response.ContentType != "" { |
| 171 | c.Ctx.Output.Header("Content-Type", response.ContentType) |
| 172 | } |
| 173 | statusCode := response.StatusCode |
| 174 | if statusCode == 0 { |
| 175 | statusCode = http.StatusOK |
| 176 | } |
| 177 | |
| 178 | c.Ctx.ResponseWriter.WriteHeader(statusCode) |
| 179 | if len(response.Body) > 0 { |
| 180 | _, _ = c.Ctx.ResponseWriter.Write(response.Body) |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | type pipeSSERecorder struct { |
| 185 | header http.Header |
no test coverage detected