summaryrefslogtreecommitdiffstats
path: root/cnhttp.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-09-07 17:25:36 +0200
committerclsr <clsr@clsr.net>2017-09-07 17:25:36 +0200
commitc9759ed32ac8b50321611de56a8ff70094c802fc (patch)
tree81c29a801d702cc0a55b5ed11fdf082c1ce879ea /cnhttp.go
parent3faab92f3e509258b61c1ac36dead8b2116b3784 (diff)
downloadcn-http-0.2.1.tar.gz
cn-http-0.2.1.zip
Change emphasized back to <b>, remove incorrect hostname handlingv0.2.1
Diffstat (limited to 'cnhttp.go')
-rw-r--r--cnhttp.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/cnhttp.go b/cnhttp.go
index f12074e..29d3cc6 100644
--- a/cnhttp.go
+++ b/cnhttp.go
@@ -406,16 +406,6 @@ func (srv *server) cnpCNMToHTML(w http.ResponseWriter, r *http.Request, req *cnp
}
hdrs := req.Header.String()
hdrs = hdrs[:len(hdrs)-1]
- host, _, _ := net.SplitHostPort(r.Host)
- if host == "" && r.Host != "" {
- host = r.Host
- }
- if host == "" {
- host = r.URL.Hostname()
- }
- if host == "" {
- host = req.Host()
- }
tmpl, err := templates.Clone()
if err != nil {
@@ -432,7 +422,7 @@ func (srv *server) cnpCNMToHTML(w http.ResponseWriter, r *http.Request, req *cnp
Req: breq.String(),
Resp: bresp.String(),
Doc: doc,
- Netcat: shellquote.Join("echo", hdrs) + " | " + shellquote.Join("nc", host, port),
+ Netcat: shellquote.Join("echo", hdrs) + " | " + shellquote.Join("nc", req.Host(), port),
Site: st,
Toc: tocSection{Children: toc},
Highlight: srv.highlighting,
@@ -561,7 +551,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin
}
close := map[string]bool{
- "em": old.Emphasized && !new.Emphasized,
+ "b": old.Emphasized && !new.Emphasized,
"i": old.Alternate && !new.Alternate,
"code": old.Code && !new.Code,
"q": old.Quote && !new.Quote,
@@ -569,7 +559,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin
}
open := map[string]bool{
- "em": !old.Emphasized && new.Emphasized,
+ "b": !old.Emphasized && new.Emphasized,
"i": !old.Alternate && new.Alternate,
"code": !old.Code && new.Code,
"q": !old.Quote && new.Quote,
@@ -592,7 +582,7 @@ func (srv *server) handleTags(req *cnp.Request, buf *bytes.Buffer, tags *[]strin
}
*tags = t[:pop]
- tagPush(buf, tags, open, "em", "<em>")
+ tagPush(buf, tags, open, "b", "<b>")
tagPush(buf, tags, open, "i", "<i>")
tagPush(buf, tags, open, "code", "<code>")
tagPush(buf, tags, open, "q", "<q>")