Skip to content

Commit

Permalink
Fix #70 - avoid panic with error check
Browse files Browse the repository at this point in the history
  • Loading branch information
unrolled committed May 21, 2020
1 parent ab726b2 commit d5d72e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions secure.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ func (s *Secure) Process(w http.ResponseWriter, r *http.Request) error {
// In addition, the generated nonce for the request is returned as well as the error value.
func (s *Secure) ProcessAndReturnNonce(w http.ResponseWriter, r *http.Request) (string, error) {
responseHeader, newR, err := s.processRequest(w, r)
if err != nil {
return "", err
}

addResponseHeaders(responseHeader, w)

return CSPNonce(newR.Context()), err
Expand Down

0 comments on commit d5d72e7

Please sign in to comment.