Skip to content

Commit

Permalink
Poolit
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Jul 4, 2024
1 parent 1f3dbc2 commit a6ab9a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions handlers/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ func Embed() fiber.Handler {
sb.WriteString("/")
sb.WriteString(strconv.Itoa(max(1, mediaNum)))
viewsData.VideoURL = sb.String()
descEscaped := make([]byte, 0, len(viewsData.Description)*2)
descEscaped = fasthttp.AppendQuotedArg(descEscaped, utils.S2B(viewsData.Description))
viewsData.OEmbedURL = c.BaseURL() + "/oembed?text=" + utils.B2S(descEscaped) + "&url=" + viewsData.URL

descPool := bytebufferpool.Get()
defer bytebufferpool.Put(descPool)
fasthttp.AppendQuotedArg(descPool.B, utils.S2B(viewsData.Description))
viewsData.OEmbedURL = c.BaseURL() + "/oembed?text=" + utils.B2S(descPool.Bytes()) + "&url=" + viewsData.URL
}

if direct {
Expand Down

0 comments on commit a6ab9a9

Please sign in to comment.