Age | Commit message (Collapse) | Author |
|
The mypy type checker deals badly when a binding changes its type. To
ease porting to mypy, avoid changing the type of variables. In some
cases, variables can be eliminated. In other cases, they are renamed.
|
|
cgitb.html returns str, but wsgi must return bytes.
|
|
The __call__ method may return None to indicate failure. Using
compare_digest with a None value results in a TypeError.
Fixes: ab06a888e216 ("use secrets.compare_digest when available")
|
|
Reported-by: pylint
|
|
The potential wsgi 2.0 standard didn't happen. Schedule adapters for
removal.
|
|
Since PEP475 or Python 3.5, select retries an interrupted system call.
However, we were relying on the previous behaviour. Thus we must
interrupt select using some other measure. Another socketpair is created
and the signal handler transfers a byte on shutdown.
|
|
|
|
When an iterable is returned and a Content-Length header is already
present, don't add a second one.
|
|
On Python 2.x, any integer sorts below the empty tuple. That was
exploited in the maxstore parameter, but fails on Python 3 with a
TypeError.
Also add a regression test.
Reported-by: Dominik Brodowski <mail@dominikbrodowski.net>
|
|
|
|
|
|
|
|
|
|
|
|
There is no reason to use old-style classes beyond laziness.
|
|
With unicode strings it no longer holds that if s.isdigit() then you can
safely int(s), because there are more digits (such as ^3 \xb3) accepted
by isdigit. This can cause an uncaught ValueError in certain places if
the remote scgi server presents bogus data. Thanks to Klaus Aehlig for
pointing out what isdigit accepts.
|
|
Clarify the type of the log file-like passed to RequestLogWSGIFilter.
|
|
The intent is to port the changes from 0.2.4 to py3k.
Conflicts:
README
test.py
wsgitools/scgi/forkpool.py
All conflicts were resolved in a minimal way. The test suite now fails
for all python versions.
|
|
|
|
The limit is only set on workers does not apply to the master. Upon
reaching the soft limit the worker terminates after finished the current
request.
|
|
The forkpool server was incompatible with dumb generators. They only
call start_response when being asked for the first output element, but
the forkpool server was wrongly requiring start_response to be called
before returning the iterator.
|
|
It can be stored inside the config attribute.
|
|
The interface and port attributes are always used together. Combine them
in order to reduce complexity.
|
|
Define a textopen function that returns "native strings" (in the sense
of pep3333). Therefore textopen needs to decode using iso-8859-1 iff
running on py3k. Additionally use a with construct to close the file
being read in all circumstances.
|
|
There is no file builtin, and binary mode gives bytes instead of str.
|
|
* applications returned errors as str instead of bytes
* filters documentation updated with bytes
* various filters expecting str where bytes are passed
* escape_string also needs to use bytes.isalnum instead of str.isalnum
* middlewares injecting str where bytes are expected
|
|
* hashlib.md5 wants bytes now.
* string.decode("base64") is now base64.b64decode and works on bytes
* binascii.unhexlify is now base64.b16decode and also works on bytes
* str.isalnum accepts umlauts, use bytes.isalnum instead
|
|
Note that the construction of the header moved from our internal
sendheaders function to the start_response function. This way users
supplying unicode characters no representable in iso-8859-1 will get a
UnicodeEncodeError back from start_response, which is more useful than
failing later while yielding bytes.
|
|
|
|
|
|
Convert the request body data from str to bytes. This replaces all
StringIOs with BytesIOs (removing backwards one more backwards
compatibility). Also all character sequences involved in request bodies
get a b"" prefix. The StaticContent application takes bytes instead of
str (no difference for py2x). The GzipWSGIFilter needs a fixed as a
truncate of a BytesIO does not rewind the stream position.
|
|
|
|
|
|
|
|
|
|
When a sendfile library is available, expose it via wsgi.file_wrapper.
This support spans both asynchronous and forkpool.
|
|
|
|
|
|
|
|
Previously middlewares mostly gave up and acted as pass through when a
second start_response call occurred. Now they try to handle this
situation.
|
|
This was basically a rewrite of the NoWriteCallableMiddleware, because
the wrong assumption of start_response not being called twice was used
in too many places.
|
|
|
|
Said RFC is quite precise on which values of a challenge are to be
quoted. I didn't honour those parts and many applications do not enforce
these requirements, so I didn't notice. Now I explain which values are
to be quoted in the hopes that it works with "Wget/1.10.2 (Red Hat
modified)".
|
|
* added a number of internal links (L{...})
* some fixes
* some additions
|
|
Conflicts:
wsgitools/digest.py
|
|
The method no longer receives a start_response and is no longer
responsible for calling self.app. Instead it returns a dictionary with
the result of the authentication.
|
|
This is the inverse of parse_digest_response and also supports escaping
of backslashes and quotes.
|
|
The previous version did not handle escapes at all. Now I added two test
cases for escaping and rewrote the function to meet all test cases.
|
|
This shrinks the possibility of raising something from start_response
and maybe enables to factor out this start_response modification later.
|
|
The BasicAuthMiddleware and AuthDigestMiddleware now derive from
AuthenticationMiddleware which provides common functionality.
|