Skip to content

Commit

Permalink
Fix redirect url when using mediaNum
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Jul 18, 2024
1 parent 6ea67a3 commit ff6da62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Embed(w http.ResponseWriter, r *http.Request) {

// If User-Agent is not bot, redirect to Instagram
viewsData.Title = "InstaFix"
viewsData.URL = "https://instagram.com" + r.URL.RequestURI()
viewsData.URL = "https://instagram.com" + strings.Replace(r.URL.RequestURI(), "/"+mediaNumParams, "", 1)
if !utils.IsBot(r.Header.Get("User-Agent")) {
http.Redirect(w, r, viewsData.URL, http.StatusFound)
return
Expand Down

0 comments on commit ff6da62

Please sign in to comment.