(c *gin.Context, err error)
| 556 | } |
| 557 | |
| 558 | func writeTaskMediaProxyError(c *gin.Context, err error) { |
| 559 | if c.Writer.Written() { |
| 560 | logger.LogError(c.Request.Context(), err.Error()) |
| 561 | return |
| 562 | } |
| 563 | var proxyErr *taskMediaProxyError |
| 564 | if !errors.As(err, &proxyErr) { |
| 565 | proxyErr = &taskMediaProxyError{ |
| 566 | status: http.StatusBadGateway, code: "artifact_upstream_error", |
| 567 | message: "Failed to fetch artifact content", err: err, |
| 568 | } |
| 569 | } |
| 570 | c.Header("Cache-Control", "private, no-store") |
| 571 | writeTaskArtifactError(c, proxyErr.status, proxyErr.code, proxyErr.message) |
| 572 | } |
| 573 | |
| 574 | func writeVideoDataURL(c *gin.Context, dataURL string) error { |
| 575 | if len(dataURL) > taskMediaDataURLMaxEncodedBytes { |
no test coverage detected