Merge branch '16265-security-updates' into dependabot/bundler/apps/workbench/loofah...
[arvados.git] / sdk / go / arvados / login.go
index 8c515468cc18d34c2413f917f175657faacea863..75ebc81c142b1ee167bafa7792923513af3c5120 100644 (file)
@@ -15,10 +15,21 @@ type LoginResponse struct {
 }
 
 func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
+       w.Header().Set("Cache-Control", "no-store")
        if resp.RedirectLocation != "" {
                w.Header().Set("Location", resp.RedirectLocation)
                w.WriteHeader(http.StatusFound)
        } else {
+               w.Header().Set("Content-Type", "text/html")
                w.Write(resp.HTML.Bytes())
        }
 }
+
+type LogoutResponse struct {
+       RedirectLocation string
+}
+
+func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
+       w.Header().Set("Location", resp.RedirectLocation)
+       w.WriteHeader(http.StatusFound)
+}