retouch the server inbox

This commit is contained in:
Ted Unangst 2020-02-18 12:43:32 -05:00
parent 370ef66b50
commit b83c9bca14
1 changed files with 5 additions and 4 deletions

9
web.go
View File

@ -455,7 +455,8 @@ func inbox(w http.ResponseWriter, r *http.Request) {
} }
func serverinbox(w http.ResponseWriter, r *http.Request) { func serverinbox(w http.ResponseWriter, r *http.Request) {
if stealthmode(serverUID, r) { user := getserveruser()
if stealthmode(user.ID, r) {
http.NotFound(w, r) http.NotFound(w, r)
return return
} }
@ -489,7 +490,6 @@ func serverinbox(w http.ResponseWriter, r *http.Request) {
http.Error(w, "what did you call me?", http.StatusTeapot) http.Error(w, "what did you call me?", http.StatusTeapot)
return return
} }
user := getserveruser()
who, _ := j.GetString("actor") who, _ := j.GetString("actor")
origin := keymatch(keyname, who) origin := keymatch(keyname, who)
if origin == "" { if origin == "" {
@ -557,11 +557,11 @@ func serverinbox(w http.ResponseWriter, r *http.Request) {
} }
func serveractor(w http.ResponseWriter, r *http.Request) { func serveractor(w http.ResponseWriter, r *http.Request) {
if stealthmode(serverUID, r) { user := getserveruser()
if stealthmode(user.ID, r) {
http.NotFound(w, r) http.NotFound(w, r)
return return
} }
user := getserveruser()
j := junkuser(user) j := junkuser(user)
w.Write(j) w.Write(j)
} }
@ -2342,6 +2342,7 @@ func serve() {
getters.HandleFunc("/server", serveractor) getters.HandleFunc("/server", serveractor)
posters.HandleFunc("/server/inbox", serverinbox) posters.HandleFunc("/server/inbox", serverinbox)
posters.HandleFunc("/inbox", serverinbox)
getters.HandleFunc("/style.css", serveasset) getters.HandleFunc("/style.css", serveasset)
getters.HandleFunc("/local.css", serveasset) getters.HandleFunc("/local.css", serveasset)