Merge branch 'master' into guess_encoding

This commit is contained in:
Maximilian Hils 2020-08-07 19:01:37 +02:00 committed by GitHub
commit 06f67d6c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 9 deletions

View File

@ -4,6 +4,8 @@ Unreleased: mitmproxy next
* Add MsgPack content viewer (@tasn)
* Use `@charset` to decode CSS files if available (@prinzhorn)
* Fix links to anticache docs in mitmweb and use HTTPS for links to documentation (@rugk)
* Updated typing for WebsocketMessage.content (@prinzhorn)
* --- TODO: add new PRs above this line ---

View File

@ -26,7 +26,7 @@ def map(km):
km.add("ctrl f", "console.nav.pagedown", ["global"], "Page down")
km.add("ctrl b", "console.nav.pageup", ["global"], "Page up")
km.add("I", "set intercept_active toggle", ["global"], "Toggle intercept")
km.add("I", "set intercept_active toggle", ["global"], "Toggle whether the filtering via the intercept option is enabled")
km.add("i", "console.command.set intercept", ["global"], "Set intercept")
km.add("W", "console.command.set save_stream_file", ["global"], "Stream to file")
km.add("A", "flow.resume @all", ["flowlist", "flowview"], "Resume all intercepted flows")

View File

@ -1,6 +1,6 @@
import time
import queue
from typing import List, Optional
from typing import List, Optional, Union
from wsproto.frame_protocol import CloseReason
from wsproto.frame_protocol import Opcode
@ -17,7 +17,7 @@ class WebSocketMessage(serializable.Serializable):
"""
def __init__(
self, type: int, from_client: bool, content: bytes, timestamp: Optional[float]=None, killed: bool=False
self, type: int, from_client: bool, content: Union[bytes, str], timestamp: Optional[float]=None, killed: bool=False
) -> None:
self.type = Opcode(type) # type: ignore
"""indicates either TEXT or BINARY (from wsproto.frame_protocol.Opcode)."""

View File

@ -9,7 +9,7 @@ deps =
setenv = HOME = {envtmpdir}
commands =
mitmdump --version
pytest --timeout 60 -v --cov-report xml \
pytest --timeout 60 -vv --cov-report xml \
--cov=mitmproxy --cov=pathod --cov=release \
--full-cov=mitmproxy/ --full-cov=pathod/ \
{posargs}

View File

@ -46,7 +46,7 @@ exports[`OptionMenu Component should render correctly 1`] = `
/>
Strip cache headers
<a
href="http://docs.mitmproxy.org/en/stable/features/anticache.html"
href="https://docs.mitmproxy.org/stable/overview-features/#anticache"
target="_blank"
>
<i

View File

@ -2,7 +2,7 @@
exports[`DocsLink Component should be able to be rendered with children nodes 1`] = `
<a
href="http://docs.mitmproxy.org/en/stable/bar"
href="https://docs.mitmproxy.org/stable/bar"
target="_blank"
>
foo
@ -11,7 +11,7 @@ exports[`DocsLink Component should be able to be rendered with children nodes 1`
exports[`DocsLink Component should be able to be rendered without children nodes 1`] = `
<a
href="http://docs.mitmproxy.org/en/stable/bar"
href="https://docs.mitmproxy.org/stable/bar"
target="_blank"
>
<i

View File

@ -25,7 +25,7 @@ function OptionMenu({ openOptions }) {
<div className="menu-group">
<div className="menu-content">
<SettingsToggle setting="anticache">
Strip cache headers <DocsLink resource="features/anticache.html"/>
Strip cache headers <DocsLink resource="overview-features/#anticache"/>
</SettingsToggle>
<SettingsToggle setting="showhost">
Use host header for display

View File

@ -6,7 +6,7 @@ DocsLink.propTypes = {
}
export default function DocsLink({ children, resource }) {
let url = `http://docs.mitmproxy.org/en/stable/${resource}`
let url = `https://docs.mitmproxy.org/stable/${resource}`
return (
<a target="_blank" href={url}>
{children || <i className="fa fa-question-circle"></i>}