Tweak how origin is determined
All checks were successful
Nix build / build-docker (pull_request) Successful in 2m23s
Nix build / build-docker-arm (pull_request) Successful in 5m22s

This commit is contained in:
Gabriel Simmer 2024-05-18 23:23:41 +01:00
parent 66bfb09ab0
commit b6a5d6332d
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ

View file

@ -482,15 +482,16 @@ WHERE id = $1 AND user_id = $2
func (s *Server) ShowPost(w http.ResponseWriter, r *http.Request) { func (s *Server) ShowPost(w http.ResponseWriter, r *http.Request) {
ui, _ := upsertUserInfo(r.Context(), s.db, s.lc, r.RemoteAddr) ui, _ := upsertUserInfo(r.Context(), s.db, s.lc, r.RemoteAddr)
var up *tailcfg.UserProfile var up *tailcfg.UserProfile
origin := "public"
if ui != nil { if ui != nil {
up = ui.UserProfile up = ui.UserProfile
origin = "tailnet"
} }
origin := "tailnet"
if valAny := r.Context().Value(privacyKey); valAny != nil { if valAny := r.Context().Value(privacyKey); valAny != nil {
if val, ok := valAny.(mixedCriticalityHandlerCtxKey); ok { if val, ok := valAny.(mixedCriticalityHandlerCtxKey); ok {
if val == isFunnel { if val == isFunnel {
up = nil up = nil
origin = "public"
} }
} }
} }