mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
remove gin, fix specialhandler and added test (#448)
This commit is contained in:
committed by
Travis Reeder
parent
1aea433d05
commit
63c2b18ac5
@@ -27,16 +27,15 @@ func (s *Server) handleSpecial(c *gin.Context) {
|
||||
|
||||
ctx = context.WithValue(ctx, "appName", "")
|
||||
ctx = context.WithValue(ctx, "routePath", c.Request.URL.Path)
|
||||
c.Set("ctx", ctx)
|
||||
|
||||
err := s.UseSpecialHandlers(c)
|
||||
ctx, err := s.UseSpecialHandlers(ctx, c.Request, c.Writer)
|
||||
if err != nil {
|
||||
log.WithError(err).Errorln("Error using special handler!")
|
||||
c.JSON(http.StatusInternalServerError, simpleError(errors.New("Failed to run function")))
|
||||
return
|
||||
}
|
||||
|
||||
ctx = c.MustGet("ctx").(context.Context)
|
||||
c.Set("ctx", ctx)
|
||||
if ctx.Value("appName").(string) == "" {
|
||||
log.WithError(err).Errorln("Specialhandler returned empty app name")
|
||||
c.JSON(http.StatusBadRequest, simpleError(models.ErrRunnerRouteNotFound))
|
||||
|
||||
Reference in New Issue
Block a user