fix: Encode tenor search query (#43)

This commit is contained in:
Anthony Laibe 2021-09-20 18:21:30 +02:00 committed by GitHub
parent 9e4c12f408
commit c716a89544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import strformat
import os import os
import sequtils import sequtils
import chronicles import chronicles
import uri
from statusgo_backend/gif import getRecentGifs, getFavoriteGifs, setFavoriteGifs, setRecentGifs from statusgo_backend/gif import getRecentGifs, getFavoriteGifs, setFavoriteGifs, setRecentGifs
@ -105,7 +106,7 @@ proc tenorQuery(self: GifClient, path: string): seq[GifItem] =
return @[] return @[]
proc search*(self: GifClient, query: string): seq[GifItem] = proc search*(self: GifClient, query: string): seq[GifItem] =
return self.tenorQuery(fmt("search?q={query}")) return self.tenorQuery(fmt("search?q={encodeUrl(query)}"))
proc getTrendings*(self: GifClient): seq[GifItem] = proc getTrendings*(self: GifClient): seq[GifItem] =
return self.tenorQuery("trending?") return self.tenorQuery("trending?")