Skip to content

Commit

Permalink
v1.4.3 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoye authored Mar 11, 2019
1 parent c2e2316 commit 3bccbd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lyrebird/mock/handlers/handler_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ def _parse_request(self):
# parse path
request_info = self._read_origin_request_info_from_url()
if not request_info['host']:
request_info = self._read_origin_request_info_from_header()
request_info_from_header = self._read_origin_request_info_from_header()
if len(request_info_from_header)>0 :
request_info = request_info_from_header

headers = {k:v for k,v in self.request.headers}
_request = dict(
headers=headers,
method=self.request.method,
query=self.request.args
)
_request.update(request_info)

Expand Down
6 changes: 6 additions & 0 deletions lyrebird/mock/handlers/proxy_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from flask import Response, stream_with_context
from requests.packages import urllib3
from .. import context
import urllib


# 关闭ssl警告
urllib3.disable_warnings()
Expand All @@ -23,6 +25,10 @@ def handle(self, handler_context):
if not origin_url:
return

parsed_url = urllib.parse.urlparse(origin_url)
if not parsed_url.hostname:
return

method = request.method
data = request.get_data() or request.form or None
headers = dict()
Expand Down
2 changes: 1 addition & 1 deletion lyrebird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
IVERSION = (1, 4, 2)
IVERSION = (1, 4, 3)
VERSION = ".".join(str(i) for i in IVERSION)
LYREBIRD = "Lyrebird " + VERSION

0 comments on commit 3bccbd3

Please sign in to comment.