forked from p15670423/monkey
Fix inconsistent return value in send_head
This commit is contained in:
parent
637b704fa2
commit
39ab50f376
|
@ -1,10 +1,14 @@
|
|||
import urllib, BaseHTTPServer, threading, os.path
|
||||
import monkeyfs
|
||||
from logging import getLogger
|
||||
from base import TransportProxyBase, update_last_serve_time
|
||||
from urlparse import urlsplit
|
||||
import BaseHTTPServer
|
||||
import os.path
|
||||
import select
|
||||
import socket
|
||||
import threading
|
||||
import urllib
|
||||
from logging import getLogger
|
||||
from urlparse import urlsplit
|
||||
|
||||
import monkeyfs
|
||||
from base import TransportProxyBase, update_last_serve_time
|
||||
|
||||
__author__ = 'hoffer'
|
||||
|
||||
|
@ -57,7 +61,7 @@ class FileServHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||
def send_head(self):
|
||||
if self.path != '/' + urllib.quote(os.path.basename(self.filename)):
|
||||
self.send_error(500, "")
|
||||
return
|
||||
return None, 0, 0
|
||||
f = None
|
||||
try:
|
||||
f = monkeyfs.open(self.filename, 'rb')
|
||||
|
|
Loading…
Reference in New Issue