Skip to content

Commit

Permalink
Return error when failed to get new /share/ postID
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Jan 12, 2025
1 parent cd00984 commit 73fe598
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handlers/embed.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handlers

import (
"errors"
scraper "instafix/handlers/scraper"
"instafix/utils"
"instafix/views"
Expand Down Expand Up @@ -43,6 +44,9 @@ func getSharePostID(postID string) (string, error) {
return "", err
}
postID = path.Base(redirURL.Path)
if postID == "login" {
return "", errors.New("not logged in")
}
return postID, nil
}

Expand Down

0 comments on commit 73fe598

Please sign in to comment.