mirror of
https://github.com/zedeus/nitter.git
synced 2026-03-05 13:30:19 -05:00
Fix /pic/ exploit
This commit is contained in:
@@ -93,6 +93,8 @@ proc createMediaRouter*(cfg: Config) =
|
|||||||
|
|
||||||
get re"^\/pic\/orig\/(enc)?\/?(.+)":
|
get re"^\/pic\/orig\/(enc)?\/?(.+)":
|
||||||
var url = decoded(request, 1)
|
var url = decoded(request, 1)
|
||||||
|
cond "amplify_video" notin url
|
||||||
|
|
||||||
if "twimg.com" notin url:
|
if "twimg.com" notin url:
|
||||||
url.insert(twimg)
|
url.insert(twimg)
|
||||||
if not url.startsWith(https):
|
if not url.startsWith(https):
|
||||||
@@ -107,6 +109,8 @@ proc createMediaRouter*(cfg: Config) =
|
|||||||
|
|
||||||
get re"^\/pic\/(enc)?\/?(.+)":
|
get re"^\/pic\/(enc)?\/?(.+)":
|
||||||
var url = decoded(request, 1)
|
var url = decoded(request, 1)
|
||||||
|
cond "amplify_video" notin url
|
||||||
|
|
||||||
if "twimg.com" notin url:
|
if "twimg.com" notin url:
|
||||||
url.insert(twimg)
|
url.insert(twimg)
|
||||||
if not url.startsWith(https):
|
if not url.startsWith(https):
|
||||||
|
|||||||
Reference in New Issue
Block a user