mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 06:46:14 +00:00
Drop rfc3986 dep, clean up internals
- Replace rfc3986 with stdlib urllib.parse - Remove deprecated status code aliases (resume_incomplete/resume) that were marked for removal in 3.0 - Remove private ThreadPoolExecutor API usage in BackgroundQueue - Clean up stale comments (old Starlette PR refs, requests attribution) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-2
@@ -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):
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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",),
|
||||
|
||||
Reference in New Issue
Block a user