| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Do not instruct browsers to transparently uncompress gzipped files.
|
|
|
| |
Change capitalization to title case for consistency.
|
| |
|
| |
|
| |
|
|
|
| |
a little clearer
|
| |
|
|
|
|
|
| |
The adapter is deprecated, only cherrypy <9 is supported, and that breaks
tests for Python 3.9.
|
| |
|
|
|
|
| |
from <module:name GET /route> to <GET /route -> module:name>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current improvement really helps when using multiple apps.
When I start such an application I like logging which routes are
available, for example one can do:
```
for r in main_app.routes:
print(r)
```
Which previously gave this:
```
<GET '<:re:(de|us)?\\/?>' <function index at 0x7f750fda9670>>
<GET '/<:re:(de/|us/)?>hello/<name:path>/<_id:int>/' <function _index_with_param at 0x7f750fda9700>>
<GET '/<:re:(de/|us/)?><:re:foo>/' <function _index at 0x7f750fda9820>>
<GET '/<:re:(de/|us/)?><url:path>/' <function main at 0x7f750fda9940>>
<GET '<:re:(de|us)?\\/?>' <function main at 0x7f750fda9940>>
<GET '/admin/login/' <function Auth.get_login_template at 0x7f751061e670>>
<POST '/admin/login/' <function Auth.post_login_template at 0x7f751061e700>>
<GET '/admin/' <function index at 0x7f750fd21940>>
<GET '/editor/' <function editor at 0x7f750f930ca0>>
<POST '/editor/template/' <function template_ at 0x7f750f930dc0>>
<GET '/editor/preview/<name:path>' <function load_tmp_template at 0x7f750f930ee0>>
<POST '/editor/validate-jinja/' <function convert at 0x7f750f937040>>
<GET '/static/front/<filepath:path>' <function app_factory.<locals>.server_static at 0x7f750f937af0>>
<GET '/static/admin/<filepath:path>' <function app_factory.<locals>.server_static at 0x7f750f937c10>>
<GET '/static/editor/<filepath:path>' <function app_factory.<locals>.server_static at 0x7f750f937d30>>
```
Memory addresses are of very little use (I can only tell which route is
which because I mount them to different prefixes (e.g. editor, admin,
etc.). This also mathes the directory structure on the file system.
However, this is not always the case, some times I mount applications
without prefix.
With the current patch I can immidietly tell where a route is coming
from:
```
apps.front.views:index GET <:re:(de|us)?\/?>
apps.front.views:_index_with_param GET /<:re:(de/|us/)?>hello/<name:path>/<_id:int>/
apps.front.views:_index GET /<:re:(de/|us/)?><:re:foo>/
apps.front.views:main GET /<:re:(de/|us/)?><url:path>/
apps.front.views:main GET <:re:(de|us)?\/?>
tiny.auth:get_login_template GET /admin/login/
tiny.auth:post_login_template POST /admin/login/
apps.admin.views:index GET /admin/
apps.editor.views:editor GET /editor/
apps.editor.views:template_ POST /editor/template/
apps.editor.views:load_tmp_template GET /editor/preview/<name:path>
apps.editor.views:convert POST /editor/validate-jinja/
__main__:server_static GET /static/front/<filepath:path>
__main__:server_static GET /static/admin/<filepath:path>
__main__:server_static GET /static/editor/<filepath:path>
```
I think this little patch might be usefull for others too.
|
| |
|
| |
|
|
|
|
|
| |
fapws3 is unmaintained for 3 years and breaks tests.
Python 3.5 is end-of-life.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This logic was added to satisfy pep-3333, where the error handling section
says application authors should "never trap errors raised by start_response
when exc_info is being provided".
However, this appears to be intended to prevent applications from catching
exc_info being re-raised by start_response(), which happens when an
application tries to send an error response (includes exc_info), but can't
as output has already been written to the client. These exceptions should
be thrown up to the server so it can abort the connection, not caught by
the application.
In this case, the start_response() call in question may be an error
response, but it's always the first call to start_response(), so should
never re-raise exc_info in this way. As such, the special handling is
unnecessary.
|
|
|
|
| |
Hope it's enough. Exception raising in wsgi() is covered
|
|
|
|
|
|
|
|
|
|
|
| |
Recommended by pep-3333 to enable middleware to provide exception handling
services, e.g. custom exception logging.
See https://www.python.org/dev/peps/pep-3333/#error-handling
Note that the exc_info is temporarily stored in the environ to pass it up
from _handler() to wsgi(), where start_response() is called. There may be
a better way to do this, e.g. storing it in the response object.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This are tested and should work for all users running
Python3.8 and Python3.9.
|
|
|
|
| |
This version is EOL since 2020-09-05.
|
|
|
|
| |
This Python version is EOL since 2019-03-18.
|
|
|
|
|
| |
Mutating the passed in dict can produce unexpected results if the caller
re-uses the dict, e.g. uses the same set of headers for multiple files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It looks that #602 is gone, but I'm not sure when exactly it was fixed.
I see that there is a suspicious change [here](https://github.com/bottlepy/bottle/commit/d85a6983ceedacd9ab9afbcd027139d8773b67ac):
environ['PATH_INFO'] = path.encode('latin1').decode('utf8', 'ignore')
Where original cause of the error was removed and replaced by `'ignore'`.
Also fixed deprecation warnings, where:
@self.subapp.route('')
Does exactly same thing as this:
@self.subapp.route('/test/<test>')
Where `''` is passed to `route()`, then `makelist()` utility assumes that nothing is passed and falls back to path autogeneration from callbackf unction. Not sure if this is expected behaviour?
|
| |
|
| |
|
| |
|
|
|
| |
look 13 lines down
|
| |
|
|
|
|
|
|
|
|
| |
from standart module "operator"
```
def is_not(a, b):
"Same as a is not b."
return a is not b
```
|
|
|
|
|
|
|
|
|
|
|
| |
Using `;` as a separator instead of `&` was allowed a long time ago,
but is now obsolete and actually invalid according to the 2014 W3C
recommendations. Even if this change is technically backwards-incompatible,
no real-world application should depend on broken behavior. If you REALLY
need this functionality, monkey-patch the _parse_qsl() function.
# Conflicts:
# bottle.py
|
| |
|
| |
|
| |
|
|
|
| |
* Fixed link to WSGI Specification
|
|
|
|
| |
Related to #1194
|
|
|
|
| |
bottle.Router.rule_syntax
|
|
|
|
|
|
| |
The affected pattern is only used from a single non-public function,
which in turn is not actually used anywhere. It's in dead code. No
security issue.
|
|
|
|
| |
This reverts commit 085f18615fe8ab63588eebfd25bb90337aac2ba0.
|
|
|
|
| |
This means configuration is only pulled from what is supplied through Bottle, not (for example) re-parsed from the commandline. Follows documented approach at http://docs.gunicorn.org/en/stable/custom.html
|
|
|
|
| |
setting expires with naive datetime is treated as UTC time
|
| |
|
| |
|
| |
|
| |
|