commit 339101e22f878189d88b482747c9fe560dbfd9d6 from: Oliver Lowe date: Tue Jul 05 05:19:21 2022 UTC web: present HTTP Basic Auth challenge rather than just always refusing. This gives us a nice prompt in a web browser and also lets Swift's & Objective-C's HTTP clients correctly handle authentication. commit - 5f060a33e967f5e1293714d94467e63788042e55 commit + 339101e22f878189d88b482747c9fe560dbfd9d6 blob - b03bc01a1a75e5ca7f6df8148ab33f956aac4de5 blob + 3fde7a2e9d23fbb44d973d5e1289801f8bca40d3 --- web/server.go +++ web/server.go @@ -184,6 +184,7 @@ func (h *authHandler) basicAuth(next http.Handler) htt fn := func(w http.ResponseWriter, req *http.Request) { username, password, ok := req.BasicAuth() if !ok || len(username) == 0 || len(password) == 0 { + w.Header().Set("WWW-Authenticate", `Basic realm="mailmux"`) jerror(w, "unauthorised", http.StatusUnauthorized) return }