1
0
mirror of https://github.com/httpie/cli.git synced 2026-04-26 20:02:11 +02:00

Fix displaying of status code without a status message. (#1301)

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
Batuhan Taskaya
2022-03-03 19:28:04 +03:00
committed by GitHub
parent 6f77e144e4
commit 25bd817bb2
5 changed files with 48 additions and 5 deletions
+6
View File
@@ -27,6 +27,8 @@ HTTPBIN_WITH_CHUNKED_SUPPORT = 'http://' + HTTPBIN_WITH_CHUNKED_SUPPORT_DOMAIN
TESTS_ROOT = Path(__file__).parent.parent
CRLF = '\r\n'
COLOR = '\x1b['
COLOR_RE = re.compile(r'\x1b\[\d+(;\d+)*?m', re.MULTILINE)
HTTP_OK = '200 OK'
# noinspection GrazieInspection
HTTP_OK_COLOR = (
@@ -38,6 +40,10 @@ HTTP_OK_COLOR = (
DUMMY_URL = 'http://this-should.never-resolve' # Note: URL never fetched
def strip_colors(colorized_msg: str) -> str:
return COLOR_RE.sub('', colorized_msg)
def mk_config_dir() -> Path:
dirname = tempfile.mkdtemp(prefix='httpie_config_')
return Path(dirname)