mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user