Skip to content

Commit

Permalink
Fix wrong postID from /share/ url
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Feb 21, 2025
1 parent ebde35d commit 957dd63
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions handlers/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ func getSharePostID(postID string) (string, error) {
if err != nil {
return postID, err
}
postID = path.Base(redirURL.Path)
if postID == "login" {
if path.Base(redirURL.Path) == "login" {
return postID, errors.New("not logged in")
}
return postID, nil
return path.Base(redirURL.Path), nil
}

func Embed(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 957dd63

Please # to comment.