Skip to content

Commit

Permalink
fix: Handling of cookies when share is story only
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Jan 24, 2024
1 parent e563515 commit 919a6b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/fibr/fibr.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func (s Service) parseRequest(r *http.Request) (provider.Request, error) {
Path: r.URL.Path,
CanEdit: false,
CanShare: false,
Display: provider.ParseDisplay(r.URL.Query().Get("d")),
Preferences: parsePreferences(r),
}

Expand All @@ -57,8 +56,12 @@ func (s Service) parseRequest(r *http.Request) (provider.Request, error) {
return request, model.WrapUnauthorized(err)
}

if len(r.URL.Query().Get("d")) == 0 {
request.Display = request.LayoutPath(request.AbsoluteURL(""))
if len(request.Display) == 0 {
if displayParam := r.URL.Query().Get("d"); len(displayParam) == 0 {
request.Display = request.LayoutPath(request.AbsoluteURL(""))
} else {
request.Display = provider.ParseDisplay(displayParam)
}
}

request = request.UpdatePreferences()
Expand Down

0 comments on commit 919a6b3

Please sign in to comment.