revert previous, doesn't seem to help
This commit is contained in:
parent
af4c98c07d
commit
fd0aff3099
10
web.go
10
web.go
|
@ -1019,7 +1019,6 @@ func trackback(xid string, r *http.Request) {
|
||||||
|
|
||||||
func showonehonk(w http.ResponseWriter, r *http.Request) {
|
func showonehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
name := mux.Vars(r)["name"]
|
name := mux.Vars(r)["name"]
|
||||||
xid := mux.Vars(r)["xid"]
|
|
||||||
user, err := butwhatabout(name)
|
user, err := butwhatabout(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
|
@ -1029,14 +1028,12 @@ func showonehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
xid = fmt.Sprintf("%s/%s/%s", user.URL, honkSep, xid)
|
xid := fmt.Sprintf("https://%s%s", serverName, r.URL.Path)
|
||||||
|
|
||||||
if fof := friendorfoe(r.Header.Get("Accept")); fof || strings.HasSuffix(r.URL.Path, ".json") {
|
if friendorfoe(r.Header.Get("Accept")) {
|
||||||
j, ok := gimmejonk(xid)
|
j, ok := gimmejonk(xid)
|
||||||
if ok {
|
if ok {
|
||||||
if fof {
|
|
||||||
trackback(xid, r)
|
trackback(xid, r)
|
||||||
}
|
|
||||||
w.Header().Set("Content-Type", theonetruename)
|
w.Header().Set("Content-Type", theonetruename)
|
||||||
w.Write(j)
|
w.Write(j)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1082,7 +1079,7 @@ func showonehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
templinfo["ServerMessage"] = "one honk maybe more"
|
templinfo["ServerMessage"] = "one honk maybe more"
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
templinfo["APAltLink"] = templates.Sprintf("<link href='%s.json' rel='alternate' type='application/activity+json'>", xid)
|
templinfo["APAltLink"] = templates.Sprintf("<link href='%s' rel='alternate' type='application/activity+json'>", xid)
|
||||||
honkpage(w, u, honks, templinfo)
|
honkpage(w, u, honks, templinfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2578,7 +2575,6 @@ func serve() {
|
||||||
getters.HandleFunc("/rss", showrss)
|
getters.HandleFunc("/rss", showrss)
|
||||||
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}", showuser)
|
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}", showuser)
|
||||||
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/"+honkSep+"/{xid:[\\pL[:digit:]]+}", showonehonk)
|
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/"+honkSep+"/{xid:[\\pL[:digit:]]+}", showonehonk)
|
||||||
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/"+honkSep+"/{xid:[\\pL[:digit:]]+}.json", showonehonk)
|
|
||||||
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/rss", showrss)
|
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/rss", showrss)
|
||||||
posters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/inbox", inbox)
|
posters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/inbox", inbox)
|
||||||
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/outbox", outbox)
|
getters.HandleFunc("/"+userSep+"/{name:[\\pL[:digit:]]+}/outbox", outbox)
|
||||||
|
|
Loading…
Reference in New Issue