Skip to content

Commit d5d72e7

Browse files
committed
Fix #70 - avoid panic with error check
1 parent ab726b2 commit d5d72e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

secure.go

+4
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ func (s *Secure) Process(w http.ResponseWriter, r *http.Request) error {
250250
// In addition, the generated nonce for the request is returned as well as the error value.
251251
func (s *Secure) ProcessAndReturnNonce(w http.ResponseWriter, r *http.Request) (string, error) {
252252
responseHeader, newR, err := s.processRequest(w, r)
253+
if err != nil {
254+
return "", err
255+
}
256+
253257
addResponseHeaders(responseHeader, w)
254258

255259
return CSPNonce(newR.Context()), err

0 commit comments

Comments
 (0)