diff --git a/responder/background.py b/responder/background.py index 7f35da3..5c1482e 100644 --- a/responder/background.py +++ b/responder/background.py @@ -16,9 +16,6 @@ class BackgroundQueue: self.results = [] def run(self, f, *args, **kwargs): - self.pool._max_workers = self.n - self.pool._adjust_thread_count() - f = self.pool.submit(f, *args, **kwargs) self.results.append(f) return f diff --git a/responder/models.py b/responder/models.py index e7ed81c..a28a1d8 100644 --- a/responder/models.py +++ b/responder/models.py @@ -5,7 +5,7 @@ from http.cookies import SimpleCookie from urllib.parse import parse_qs import chardet -import rfc3986 +from urllib.parse import urlparse from starlette.requests import Request as StarletteRequest from starlette.requests import State from starlette.responses import ( @@ -162,7 +162,7 @@ class Request: @property def url(self): """The parsed URL of the Request.""" - return rfc3986.urlparse(self.full_url) + return urlparse(self.full_url) @property def cookies(self): diff --git a/responder/staticfiles.py b/responder/staticfiles.py index c13f002..3b0c11a 100644 --- a/responder/staticfiles.py +++ b/responder/staticfiles.py @@ -2,19 +2,7 @@ from starlette.staticfiles import StaticFiles as StarletteStaticFiles class StaticFiles(StarletteStaticFiles): - """ - Extension to Starlette's `StaticFiles`. - - I've created an issue to discuss allowing multiple directories in - Starlette's `StaticFiles`. - - https://github.com/encode/starlette/issues/625 - - I've also made a PR to add this method to Starlette StaticFiles - Once accepted we will remove this. - - https://github.com/encode/starlette/pull/626 - """ + """Extension to Starlette's StaticFiles with support for multiple directories.""" def add_directory(self, directory: str) -> None: self.all_directories = [*self.all_directories, *self.get_directories(directory)] diff --git a/responder/status_codes.py b/responder/status_codes.py index 71e371a..f68ef59 100644 --- a/responder/status_codes.py +++ b/responder/status_codes.py @@ -1,5 +1,3 @@ -# from: https://github.com/requests/requests/blob/master/requests/status_codes.py - codes = { # Informational. 100: ("continue",), @@ -26,11 +24,7 @@ codes = { 305: ("use_proxy",), 306: ("switch_proxy",), 307: ("temporary_redirect", "temporary_moved", "temporary"), - 308: ( - "permanent_redirect", - "resume_incomplete", - "resume", - ), # These 2 to be removed in 3.0 + 308: ("permanent_redirect",), # Client Error. 400: ("bad_request", "bad"), 401: ("unauthorized",), diff --git a/setup.py b/setup.py index 9a5c287..404813f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,6 @@ required = [ "chardet", "marshmallow", "python-multipart", - "rfc3986", "servestatic", "starlette[full]>=0.40", "uvicorn[standard]",