diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-01-17 12:26:44 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-01-17 12:26:44 +0100 |
commit | e89524b31472c1997113b086053ba0d65798636f (patch) | |
tree | 0c328734be17c8655ba7a60580d711c578ac1dbb | |
parent | 1851d8038f4faffb71f389b79d7914641aeda111 (diff) | |
download | qutebrowser-e89524b31472c1997113b086053ba0d65798636f.tar.gz qutebrowser-e89524b31472c1997113b086053ba0d65798636f.zip |
rfc6266: Remove more dead code
-rw-r--r-- | qutebrowser/browser/webkit/rfc6266.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/qutebrowser/browser/webkit/rfc6266.py b/qutebrowser/browser/webkit/rfc6266.py index 814fac6df..35d7895cb 100644 --- a/qutebrowser/browser/webkit/rfc6266.py +++ b/qutebrowser/browser/webkit/rfc6266.py @@ -20,41 +20,15 @@ """pyPEG parsing for the RFC 6266 (Content-Disposition) header.""" import email.headerregistry -import urllib.parse -import string -import re -import dataclasses -from typing import Optional - -import pypeg2 as peg from qutebrowser.utils import utils -@dataclasses.dataclass -class LangTagged: - - """A string with an associated language.""" - - string: str - langtag: Optional[str] - - class Error(Exception): """Base class for RFC6266 errors.""" -class DuplicateParamError(Error): - - """Exception raised when a parameter has been given twice.""" - - -class InvalidISO8859Error(Error): - - """Exception raised when a byte is invalid in ISO-8859-1.""" - - class _ContentDisposition: """Records various indications and hints about content disposition. @@ -127,19 +101,3 @@ def parse_headers(content_disposition): return _ContentDisposition(disposition=parsed.content_disposition, params=parsed.params) - - -def parse_ext_value(val): - """Parse the value of an extended attribute.""" - if len(val) == 3: - charset, langtag, coded = val - else: - charset, coded = val - langtag = None - decoded = urllib.parse.unquote(coded, charset, errors='strict') - if charset == 'iso-8859-1': - # Fail if the filename contains an invalid ISO-8859-1 char - for c in decoded: - if 0x7F <= ord(c) <= 0x9F: - raise InvalidISO8859Error(c) - return LangTagged(decoded, langtag) |