Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
python-bottle
0002_Gracefully_handle_errors_during_early_requ...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002_Gracefully_handle_errors_during_early_request_binding.patch of Package python-bottle
From e140e1b54da721a660f2eb9d58a106b7b3ff2f00 Mon Sep 17 00:00:00 2001 From: Marcel Hellkamp <marc@gsites.de> Date: Thu, 26 May 2022 14:49:32 +0200 Subject: [PATCH] Gracefully handle errors during early request binding. --- bottle.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bottle.py b/bottle.py index 04ccf7d..035f99e 100644 --- a/bottle.py +++ b/bottle.py @@ -848,17 +848,19 @@ class Bottle(object): return tob(template(ERROR_PAGE_TEMPLATE, e=res)) def _handle(self, environ): - path = environ['bottle.raw_path'] = environ['PATH_INFO'] - if py3k: - try: - environ['PATH_INFO'] = path.encode('latin1').decode('utf8') - except UnicodeError: - return HTTPError(400, 'Invalid path string. Expected UTF-8') - try: + environ['bottle.app'] = self request.bind(environ) response.bind() + + path = environ['bottle.raw_path'] = environ['PATH_INFO'] + if py3k: + try: + environ['PATH_INFO'] = path.encode('latin1').decode('utf8') + except UnicodeError: + return HTTPError(400, 'Invalid path string. Expected UTF-8') + try: self.trigger_hook('before_request') route, args = self.router.match(environ) -- 2.37.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor