1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

proxy: ensure proxy cert download sets content length

proxy options: 'use_default_coll' must specify exact default coll
(otherwise a random coll is chosen, as ordering is not defined)
travis: add py3.4, py3.5!
This commit is contained in:
Ilya Kreymer 2016-02-23 18:09:09 -08:00
parent cebd6b6239
commit 1d5b23413f
5 changed files with 16 additions and 7 deletions

View File

@ -3,6 +3,9 @@ language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
os:
- linux

View File

@ -441,9 +441,11 @@ class ProxyRouter(object):
buff = fh.read()
content_type = 'application/x-x509-ca-cert'
headers = [('Content-Length', str(len(buff)))]
return WbResponse.bin_stream([buff],
content_type=content_type)
content_type=content_type,
headers=headers)
elif env['pywb.proxy_req_uri'] == self.CERT_DL_P12:
if not self.ca:
@ -452,6 +454,8 @@ class ProxyRouter(object):
buff = self.ca.get_root_PKCS12()
content_type = 'application/x-pkcs12'
headers = [('Content-Length', str(len(buff)))]
return WbResponse.bin_stream([buff],
content_type=content_type)
content_type=content_type,
headers=headers)

View File

@ -21,7 +21,7 @@ import json
class BaseCollResolver(object):
def __init__(self, routes, config):
self.routes = routes
self.use_default_coll = config.get('use_default_coll', True)
self.use_default_coll = config.get('use_default_coll')
@property
def pre_connect(self):
@ -58,9 +58,10 @@ class BaseCollResolver(object):
# if 'use_default_coll', find first WbUrl-handling collection
elif self.use_default_coll:
for route in self.routes:
if isinstance(route.handler, WbUrlHandler):
return route, route.path, matcher, ts, None
raise Exception('use_default_coll: true no longer supported, please specify collection name')
#for route in self.routes:
# if isinstance(route.handler, WbUrlHandler):
# return route, route.path, matcher, ts, None
# otherwise, return the appropriate coll selection response
else:

View File

@ -114,7 +114,7 @@ enable_http_proxy: true
# Additional proxy options (defaults)
proxy_options:
use_default_coll: true
use_default_coll: pywb
cookie_resolver: false

View File

@ -22,6 +22,7 @@ enable_http_proxy: true
proxy_options:
use_banner: false
use_client_rewrite: false
use_default_coll: pywb
# enable cdx server api for timemap
enable_cdx_api: true