Skip to content

Commit

Permalink
Fix path to devtools websocket endpoint, broken after refactoring (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavsingh authored Oct 11, 2020
1 parent 4804c53 commit 9699904
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion proxy/http/inspector/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ def request_complete(event: Dict[str, Any]) -> Dict[str, Any]:
'wallTime': now,
'hasUserGesture': False,
'type': event['event_payload']['headers']['content-type']
if event['event_payload']['headers'].has_header('content-type')
if 'content-type' in event['event_payload']['headers']
else 'Other',
# TODO(abhinavsingh): Bring this inline with devtools protocol
'method': 'Network.requestWillBeSent',
'request': {
'url': event['event_payload']['url'],
'method': event['event_payload']['method'],
Expand Down
6 changes: 3 additions & 3 deletions proxy/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
from .core.acceptor import AcceptorPool
from .http.handler import HttpProtocolHandler
from .common.flag import flags
from .common.constants import COMMA, DEFAULT_BASIC_AUTH, DEFAULT_DISABLE_HTTP_PROXY, PY2_DEPRECATION_MESSAGE
from .common.constants import COMMA, DEFAULT_BASIC_AUTH, DEFAULT_DEVTOOLS_WS_PATH, DEFAULT_DISABLE_HTTP_PROXY
from .common.constants import DEFAULT_ENABLE_DASHBOARD, DEFAULT_ENABLE_DEVTOOLS
from .common.constants import DEFAULT_ENABLE_STATIC_SERVER, DEFAULT_ENABLE_WEB_SERVER
from .common.constants import DEFAULT_LOG_FILE, DEFAULT_LOG_FORMAT, DEFAULT_LOG_LEVEL
from .common.constants import DEFAULT_OPEN_FILE_LIMIT, DEFAULT_PID_FILE, DEFAULT_PLUGINS
from .common.constants import DEFAULT_VERSION, DOT, PLUGIN_DASHBOARD, PLUGIN_DEVTOOLS_PROTOCOL
from .common.constants import PLUGIN_HTTP_PROXY, PLUGIN_INSPECT_TRAFFIC, PLUGIN_PAC_FILE
from .common.constants import PLUGIN_WEB_SERVER
from .common.constants import PLUGIN_WEB_SERVER, PY2_DEPRECATION_MESSAGE

if os.name != 'nt':
import resource
Expand Down Expand Up @@ -271,7 +271,7 @@ def initialize(input_args: Optional[List[str]], **opts: Any) -> Flags:
bytes,
opts.get(
'devtools_ws_path',
getattr(args, 'devtools_ws_path', None))),
getattr(args, 'devtools_ws_path', DEFAULT_DEVTOOLS_WS_PATH))),
timeout=cast(int, opts.get('timeout', args.timeout)),
threadless=cast(bool, opts.get('threadless', args.threadless)),
enable_events=cast(
Expand Down

0 comments on commit 9699904

Please sign in to comment.