|
@@ -52,7 +52,10 @@ class Handler(BaseHTTPRequestHandler):
|
|
# write text into file
|
|
# write text into file
|
|
url = self.headers.getheader('x-url')
|
|
url = self.headers.getheader('x-url')
|
|
print "url:", url
|
|
print "url:", url
|
|
- prefix = "chrome_" + re.sub("[^.\w]", "_", re.sub("^.*?//","",url))
|
|
|
|
|
|
+ prefix = "chrome_"
|
|
|
|
+ if url:
|
|
|
|
+ prefix += re.sub("[^.\w]", "_", re.sub("^.*?//","",url))
|
|
|
|
+ prefix += "_"
|
|
if temp_has_delete==True:
|
|
if temp_has_delete==True:
|
|
f = tempfile.NamedTemporaryFile(
|
|
f = tempfile.NamedTemporaryFile(
|
|
delete=False, prefix=prefix, suffix='.txt')
|
|
delete=False, prefix=prefix, suffix='.txt')
|