Skip to content

Commit

Permalink
Merge 38dc4a3 into afad576
Browse files Browse the repository at this point in the history
  • Loading branch information
dencoded committed Aug 9, 2018
2 parents afad576 + 38dc4a3 commit 24f2dfd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"net"
"strings"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -269,6 +270,14 @@ func (r *RedisAnalyticsHandler) recordWorker() {

record.Tags = append(record.Tags, "api-"+record.APIID)

// fix paths in record as they might have omitted leading "/"
if !strings.HasPrefix(record.Path, "/") {
record.Path = "/" + record.Path
}
if !strings.HasPrefix(record.RawPath, "/") {
record.RawPath = "/" + record.RawPath
}

if encoded, err := msgpack.Marshal(record); err != nil {
log.WithError(err).Error("Error encoding analytics data")
} else {
Expand Down
2 changes: 1 addition & 1 deletion mw_jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ func TestJWTSessionExpiresAtValidationConfigs(t *testing.T) {
})

t.Run("Expired_token-Before_now-Add_skew--Valid_jwt", func(t *testing.T) {
spec.JWTExpiresAtValidationSkew = 1
spec.JWTExpiresAtValidationSkew = 2
loadAPI(spec)

ts.Run(t, test.TestCase{
Expand Down

0 comments on commit 24f2dfd

Please sign in to comment.