Skip to content

Instantly share code, notes, and snippets.

@par6n
Created June 20, 2019 17:09
Show Gist options
  • Save par6n/5a63b185dcb422dd53efa4d8fe125ab3 to your computer and use it in GitHub Desktop.
Save par6n/5a63b185dcb422dd53efa4d8fe125ab3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
from urlparse import urlparse
while sys.stdin:
try:
strLine = sys.stdin.readline().strip() ## It is very important to use strip!
uriComponents = urlparse( strLine )
if uriComponents.query == "token=correct":
print uriComponents.path
else:
print "/files/403.html"
sys.stdout.flush()
except:
print "NULL"
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment