Update tests related to make_output_collection
[arvados.git] / sdk / go / arvados / login.go
index 8c515468cc18d34c2413f917f175657faacea863..ab7637546289a659651c9648907b0558cfe1c064 100644 (file)
@@ -10,15 +10,26 @@ import (
 )
 
 type LoginResponse struct {
-       RedirectLocation string
-       HTML             bytes.Buffer
+       RedirectLocation string       `json:"redirect_location,omitempty"`
+       HTML             bytes.Buffer `json:"-"`
 }
 
 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 `json:"redirect_location,omitempty"`
+}
+
+func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
+       w.Header().Set("Location", resp.RedirectLocation)
+       w.WriteHeader(http.StatusFound)
+}