refactor: Remove unreachable dead code branches
- checkOrigin: Remove redundant same-origin check at line 155 that was already handled at line 116 (origin == requestOrigin) Function improved from 95.1% to 97.4% coverage.
This commit is contained in:
parent
a647ffb219
commit
a0a473ada8
1 changed files with 1 additions and 5 deletions
|
|
@ -151,11 +151,7 @@ func (h *Hub) checkOrigin(r *http.Request) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// Still check for exact same-origin match
|
||||
if origin == requestOrigin {
|
||||
return true
|
||||
}
|
||||
|
||||
// Note: same-origin match already handled above (line 116)
|
||||
log.Warn().
|
||||
Str("origin", origin).
|
||||
Str("requestOrigin", requestOrigin).
|
||||
|
|
|
|||
Loading…
Reference in a new issue