Skip to content

Commit

Permalink
Fix cache conflict for public keys
Browse files Browse the repository at this point in the history
Fix #1591
  • Loading branch information
buger committed Apr 5, 2018
1 parent e0bfa98 commit be3f617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions certs/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (c *CertificateManager) ListPublicKeys(keyIDs []string) (out []string) {
var err error

for _, id := range keyIDs {
if fingerprint, found := c.cache.Get(id); found {
if fingerprint, found := c.cache.Get("pub-" + id); found {
out = append(out, fingerprint.(string))
continue
}
Expand All @@ -315,7 +315,7 @@ func (c *CertificateManager) ListPublicKeys(keyIDs []string) (out []string) {

block, _ := pem.Decode(rawKey)
fingerprint := HexSHA256(block.Bytes)
c.cache.Set(id, fingerprint, cache.DefaultExpiration)
c.cache.Set("pub-"+id, fingerprint, cache.DefaultExpiration)
out = append(out, fingerprint)
}

Expand Down
4 changes: 2 additions & 2 deletions res_handler_jq_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func (h *ResponseTransformJQMiddleware) HandleResponse(rw http.ResponseWriter, r
return err
}
jqObj := map[string]interface{}{
"body": bodyObj,
"_tyk_context": ctxGetData(req),
"body": bodyObj,
"_tyk_context": ctxGetData(req),
"_tyk_response_headers": res.Header,
}

Expand Down

0 comments on commit be3f617

Please sign in to comment.