Webob

Latest version: v1.8.9

Safety actively analyzes 681857 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 9

1.2.1

Not secure
------------

* Add index page (e.g., ``index.html``) support for
:class:`webob.static.DirectoryApp`.

* Detect mime-type when creating a test request with file uploads
(``Request.blank("/", POST=dict(file1=("foo.jpg", "xxx")))``)

* Relax parsing of ``Accept`` and ``Range`` headers to allow
uppercase and extra whitespace.

* Fix docs references to some deprecated classes.

1.2

Not secure
------------

* Fix :mod:`webob.client` handling of connection-refused on Windows.

* Use ``simplejson`` in :mod:`webob.request` if present.

* Fix ``resp.retry_after = <long>`` interpreting value as a UNIX timestamp
(should interpret as time delta in seconds).

1.2rc1

Not secure
------------

* Add ``Response.json`` and ``Request.json`` which reads and sets the
body using a JSON encoding (previously only the readable attribute
``Request.json_body`` existed). ``Request.json_body`` is still
available as an alias.

* Rename ``Response.status_int`` to ``Response.status_code`` (the
``.status_int`` name is still available and will be supported
indefinitely).

* Add ``Request.text``, the unicode version of the request body
(similar to ``Response.text``).

* Add :mod:`webob.client` which contains the WSGI application
``send_request_app`` and ``SendRequest``. All requests sent to this
application are turned into HTTP requests.

* Renamed ``Request.get_response(app)`` to ``Request.send(app)``. The
``.get_response()`` name is still available.

* Use ``send_request_app`` as the default application for
``Request.send()``, so you can do:

``resp = Request.blank("http://python.org").send()``

* Add :mod:`webob.static` which contains two new WSGI applications,
:class:`FileApp` serve one static file and :class:`DirectoryApp` to serve
the content of a directory. They should provide a reusable implementation
of :doc:`file-example`. It also comes with support for ``wsgi.file_wrapper``.

The implementation has been imported and simplified from
:mod:`PasteOb.fileapp`.

* Add ``dev`` and ``docs`` setup.py aliases (to install development and docs
dependencies respectively, e.g. "python setup.py dev").

1.2b3

Not secure
------------

* Added ``request.host_port`` API (returns port number implied by HTTP_HOST,
falling back to SERVER_PORT).

* Added ``request.client_addr`` API (returns IP address implied by
HTTP_X_FORWARDED_FOR, falling back to REMOTE_ADDR).

* Fix corner-case ``response.status_int`` and ``response.status`` mutation
bug on py3 (use explicit floor division).

* Backwards incompatibility: Request and BaseRequest objects now return
Unicode for ``request.path_info`` and ``request.script_name`` under Python
2. Rationale: the legacy behavior of returning the respective raw environ
values was nonsensical on Python 3. Working with non-ascii encoded environ
variables as raw WSGI values under Python 3 makes no sense, as PEP 3333
specifies that environ variables are bytes-tunneled-as-latin-1 strings.

If you don't care about Python 3, and you need strict backwards
compatibility, to get legacy behavior of returning bytes on Python 2 for
these attributes, use ``webob.LegacyRequest`` instead of ``webob.Request``.
Although it's possible to use ``webob.LegacyRequest`` under Python 3, it
makes no sense, and it should not be used there.

* The above backwards incompatibility fixed nonsensical behavior of
``request.host_url``, ``request.application_url``, ``request.path_url``,
``request.path``, ``request.path_qs``, ``request.url``,
``request.relative_url``, ``request.path_info_peek``,
``request.path_info_pop`` under Python 3. These methods previously dealt
with raw SCRIPT_NAME and PATH_INFO values, which caused nonsensical
results.

* The WebOb Request object now respects an additional WSGI environment
variable: ``webob.url_encoding``. ``webob.url_encoding`` will be used to
decode the raw WSGI PATH_INFO and SCRIPT_NAME variables when the
``request.path_info`` and ``request.script_name`` APIs are used.

* Request objects now accept an additional constructor parameter:
``url_encoding``. ``url_encoding`` will be used to decode PATH_INFO and
SCRIPT_NAME from its WSGI-encoded values. If ``webob.url_encoding`` is not
set in the environ and ``url_encoding`` is not passed to the Request
constructor, the default value ``utf-8`` will be used to decode the
PATH_INFO and SCRIPT_NAME.

Note that passing ``url_encoding`` will cause the WSGI environment variable
``webob.url_encoding`` to be set.

* Fix ``webob.response._request_uri`` internal function to generate sensible
request URI under Python 3. This fixed a problem under Python 3 if you
were using non-absolute Location headers in responses.

1.2b2

Not secure
------

* Fix ``request.cookies.get('name', 'default')``. Previously ``default`` was
ignored.

1.2b1

Not secure
---------

* Mutating the ``request.cookies`` property now reflects the mutations into
the ``HTTP_COOKIES`` environ header.

* ``Response.etag = (tag, False)`` sets weak etag.

* ``Range`` only parses single range now.

* ``Range.satisfiable(..)`` is gone.

* ``Accept.best_matches()`` is gone; use ``list(request.accept)`` or
``request.accept.best_match(..)`` instead (applies to all Accept-*
headers) or similar with ``request.accept_language``.

* ``Response.request`` and ``Response.environ`` attrs are undeprecated and no
longer raise exceptions when used. These can also be passed to the
Response constructor. This is to support codebases that pass them to the
constructor or assign them to a response instance. However, some behavior
differences from 1.1 exist. In particular, synchronization is no longer
done between environ and request attribute properties of Response; you may
pass either to the constructor (or both) or assign one or the other or
both, but they wont be managed specially and will remain the same over the
lifetime of the response just as you passed them. Default values for both
``request`` and ``environ`` on any given response are ``None`` now.

* Undeprecated ``uscript_name`` and ``upath_info``.

* For backwards compatibility purposes, switch ``req.script_name`` and
``path_info`` back again to contain "raw" undecoded native strings rather
than text. Use ``uscript_name`` and ``upath_info`` to get the text version
of SCRIPT_NAME and PATH_INFO.

* Don't raise an exception if ``unicode_errors`` or ``decode_param_names`` is
passed to the Request constructor. Instead, emit a warning. For benefit
of Pylons 1.X, which passes both.

* Don't raise an exception if HTTPException.exception is used; instead emit a
warning. For benefit of Pylons 1.X, which uses it.

Page 3 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.