Former-commit-id: 18a1b6540895d83370677bea474ac7dd8cfa1bd2
This commit is contained in:
Henrique Dias
2017-01-02 12:20:20 +00:00
parent df4a030843
commit abcaf3aba7
8 changed files with 129 additions and 84 deletions

View File

@@ -29,9 +29,14 @@ func ServeListing(w http.ResponseWriter, r *http.Request, c *config.Config, u *c
URL: r.URL,
}
cookieScope := c.BaseURL
if cookieScope == "" {
cookieScope = "/"
}
// Copy the query values into the Listing struct
var limit int
listing.Sort, listing.Order, limit, err = handleSortOrder(w, r, c.BaseURL)
listing.Sort, listing.Order, limit, err = handleSortOrder(w, r, cookieScope)
if err != nil {
return http.StatusBadRequest, err
}
@@ -72,7 +77,7 @@ func ServeListing(w http.ResponseWriter, r *http.Request, c *config.Config, u *c
http.SetCookie(w, &http.Cookie{
Name: "display",
Value: displayMode,
Path: c.BaseURL,
Path: cookieScope,
Secure: r.TLS != nil,
})