MCPcopy
hub / github.com/tinyauthapp/tinyauth / handleError

Method handleError

internal/controller/proxy_controller.go:320–333  ·  view source on GitHub ↗
(c *gin.Context, proxyCtx ProxyContext)

Source from the content-addressed store, hash-verified

318}
319
320func (controller *ProxyController) handleError(c *gin.Context, proxyCtx ProxyContext) {
321 redirectURL := fmt.Sprintf("%s/error", controller.config.AppURL)
322
323 if !controller.useBrowserResponse(proxyCtx) {
324 c.Header("x-tinyauth-location", redirectURL)
325 c.JSON(500, gin.H{
326 "status": 500,
327 "message": "Internal Server Error",
328 })
329 return
330 }
331
332 c.Redirect(http.StatusTemporaryRedirect, redirectURL)
333}
334
335func (controller *ProxyController) getHeader(c *gin.Context, header string) (string, bool) {
336 val := c.Request.Header.Get(header)

Callers 1

proxyHandlerMethod · 0.95

Calls 1

useBrowserResponseMethod · 0.95

Tested by

no test coverage detected