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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Still check for exact same-origin match
|
// Note: same-origin match already handled above (line 116)
|
||||||
if origin == requestOrigin {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Warn().
|
log.Warn().
|
||||||
Str("origin", origin).
|
Str("origin", origin).
|
||||||
Str("requestOrigin", requestOrigin).
|
Str("requestOrigin", requestOrigin).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue