Skip to content

Commit d1f8fda

Browse files
committed
Pylint CI fix
1 parent d2e9c58 commit d1f8fda

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adafruit_httpserver/request.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ class FormData(_IXSSSafeFieldStorage):
150150
_storage: Dict[str, List[Union[str, bytes]]]
151151
files: Files
152152

153-
def _check_is_supported_content_type(self, content_type: str) -> None:
153+
@staticmethod
154+
def _check_is_supported_content_type(content_type: str) -> None:
154155
return content_type in (
155156
"application/x-www-form-urlencoded",
156157
"multipart/form-data",
@@ -164,8 +165,8 @@ def __init__(self, data: bytes, headers: Headers, *, debug: bool = False) -> Non
164165
self.content_type = headers.get_directive("Content-Type")
165166
content_length = int(headers.get("Content-Length", 0))
166167

167-
if not self._check_is_supported_content_type(self.content_type):
168-
debug and _debug_unsupported_form_content_type(self.content_type)
168+
if debug and not self._check_is_supported_content_type(self.content_type):
169+
_debug_unsupported_form_content_type(self.content_type)
169170

170171
if self.content_type == "application/x-www-form-urlencoded":
171172
self._parse_x_www_form_urlencoded(data[:content_length])
@@ -453,5 +454,6 @@ def _debug_unsupported_form_content_type(content_type: str) -> None:
453454
"""Warns when an unsupported form content type is used."""
454455
print(
455456
f"WARNING: Unsupported Content-Type: {content_type}. "
456-
"Only `application/x-www-form-urlencoded`, `multipart/form-data` and `text/plain` are supported."
457+
"Only `application/x-www-form-urlencoded`, `multipart/form-data` and `text/plain` are "
458+
"supported."
457459
)

0 commit comments

Comments
 (0)