Skip to content

Commit

Permalink
Fixes contrib for Gin v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 22, 2015
1 parent 84a9ba4 commit 6f2b4df
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func Auth(secret string) gin.HandlerFunc {
})

if err != nil {
c.Fail(401, err)
c.AbortWithError(401, err)
}
}
}
3 changes: 2 additions & 1 deletion newrelic/newrelic.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package newrelic

import (
"time"

"github.com/gin-gonic/gin"
metrics "github.com/yvasiyarov/go-metrics"
"github.com/yvasiyarov/gorelic"
"time"
)

var agent *gorelic.Agent
Expand Down
7 changes: 3 additions & 4 deletions secure/secure.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package secure

import (
"fmt"
"github.com/gin-gonic/gin"
"net/http"
"strings"

"github.com/gin-gonic/gin"
)

const (
Expand Down Expand Up @@ -170,10 +171,8 @@ func Secure(options Options) gin.HandlerFunc {
if c.Writer.Written() {
c.AbortWithStatus(c.Writer.Status())
} else {
c.Fail(http.StatusInternalServerError, err)
c.AbortWithError(http.StatusInternalServerError, err)
}
} else {
c.Next()
}
}

Expand Down
4 changes: 2 additions & 2 deletions sentry/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc {
}
if !onlyCrashes {
for _, item := range c.Errors {
packet := raven.NewPacket(item.Error.Error(), &raven.Message{
Message: item.Error.Error(),
packet := raven.NewPacket(item.Error(), &raven.Message{
Message: item.Error(),
Params: []interface{}{item.Meta},
})
client.Capture(packet, flags)
Expand Down
2 changes: 1 addition & 1 deletion sessions/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func Sessions(name string, store Store) gin.HandlerFunc {
s := &session{name, c.Request, store, nil, false, c.Writer}
c.Set(DefaultKey, s)
defer context.Clear(c.Request)
c.Next()
c.Next()
}
}

Expand Down
3 changes: 2 additions & 1 deletion static/static.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package static

import (
"github.com/gin-gonic/gin"
"net/http"
"os"
"path"
"path/filepath"
"strings"

"github.com/gin-gonic/gin"
)

type ServeFileSystem interface {
Expand Down

0 comments on commit 6f2b4df

Please sign in to comment.