projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9df3736
)
livereload: Fix host comparison when ports aren't present
author
Ivan Vyshnevskyi
<ivan@vyshnevskyi.com>
Sat, 16 Dec 2017 15:41:52 +0000
(17:41 +0200)
committer
Bjørn Erik Pedersen
<bjorn.erik.pedersen@gmail.com>
Sat, 16 Dec 2017 18:06:00 +0000
(19:06 +0100)
Compare the original hosts from 'Origin' and 'Host' headers before
attempting to do a port-less comparison. This helps in the case when
hugo server was started with a '--port=80' so both headers do not
contain a port.
Fixes #4141
livereload/livereload.go
patch
|
blob
|
history
diff --git
a/livereload/livereload.go
b/livereload/livereload.go
index 7bfbbaf6b870738b6d419b4e7b45a88a71c1c0c8..2f3cee8f047c8e2d5717f4774998b1630087d4f0 100644
(file)
--- a/
livereload/livereload.go
+++ b/
livereload/livereload.go
@@
-62,6
+62,10
@@
var upgrader = &websocket.Upgrader{
return false
}
+ if u.Host == r.Host {
+ return true
+ }
+
h1, _, err := net.SplitHostPort(u.Host)
if err != nil {
return false