Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
chore: typo fixes at roundtriper.go (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmxs committed Mar 8, 2024
1 parent dc986a7 commit 7eef0bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions roundtriper.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,24 +114,24 @@ func (r *CacheHandler) roundTripRFCCompliance(req *http.Request) (resp *http.Res

validationResult, errValidation := validateTheCacheControl(req, resp)
if errValidation != nil {
log.Printf("Can't validate the response to RFC 7234, plase check. Err: %v\n", errValidation)
log.Printf("Can't validate the response to RFC 7234, please check. Err: %v\n", errValidation)
return // return directly, not sure can be stored or not
}

if validationResult.OutErr != nil {
log.Printf("Can't validate the response to RFC 7234, plase check. Err: %v\n", validationResult.OutErr)
log.Printf("Can't validate the response to RFC 7234, please check. Err: %v\n", validationResult.OutErr)
return // return directly, not sure can be stored or not
}

// reasons to not to cache
if len(validationResult.OutReasons) > 0 {
log.Printf("Can't validate the response to RFC 7234, plase check. Err: %v\n", validationResult.OutReasons)
log.Printf("Can't validate the response to RFC 7234, please check. Err: %v\n", validationResult.OutReasons)
return // return directly, not sure can be stored or not.
}

err = storeRespToCache(r.CacheInteractor, req, resp)
if err != nil {
log.Printf("Can't store the response to database, plase check. Err: %v\n", err)
log.Printf("Can't store the response to database, please check. Err: %v\n", err)
}
// return err back to nil to make the call still success.
return resp, nil
Expand Down Expand Up @@ -159,7 +159,7 @@ func (r *CacheHandler) RoundTrip(req *http.Request) (resp *http.Response, err er

err = storeRespToCache(r.CacheInteractor, req, resp)
if err != nil {
log.Printf("Can't store the response to database, plase check. Err: %v\n", err)
log.Printf("Can't store the response to database, please check. Err: %v\n", err)
err = nil // set err back to nil to make the call still success.
}
return
Expand Down

0 comments on commit 7eef0bc

Please sign in to comment.