@@ -1363,7 +1363,7 @@ def _body(self):
1363
1363
1364
1364
def _get_body_string (self , maxread ):
1365
1365
""" Read body into a string. Raise HTTPError(413) on requests that are
1366
- to large. """
1366
+ too large. """
1367
1367
if self .content_length > maxread :
1368
1368
raise HTTPError (413 , 'Request entity too large' )
1369
1369
data = self .body .read (maxread + 1 )
@@ -1594,7 +1594,7 @@ def __getattr__(self, name):
1594
1594
def __setattr__ (self , name , value ):
1595
1595
if name == 'environ' : return object .__setattr__ (self , name , value )
1596
1596
key = 'bottle.request.ext.%s' % name
1597
- if key in self . environ :
1597
+ if hasattr ( self , name ) :
1598
1598
raise AttributeError ("Attribute already defined: %s" % name )
1599
1599
self .environ [key ] = value
1600
1600
@@ -1655,7 +1655,7 @@ class BaseResponse(object):
1655
1655
default_status = 200
1656
1656
default_content_type = 'text/html; charset=UTF-8'
1657
1657
1658
- # Header blacklist for specific response codes
1658
+ # Header denylist for specific response codes
1659
1659
# (rfc2616 section 10.2.3 and 10.3.5)
1660
1660
bad_headers = {
1661
1661
204 : frozenset (('Content-Type' , 'Content-Length' )),
@@ -2928,8 +2928,8 @@ def static_file(filename, root,
2928
2928
ims = getenv ('HTTP_IF_MODIFIED_SINCE' )
2929
2929
if ims :
2930
2930
ims = parse_date (ims .split (";" )[0 ].strip ())
2931
- if ims is not None and ims >= int (stats .st_mtime ):
2932
- return HTTPResponse (status = 304 , ** headers )
2931
+ if ims is not None and ims >= int (stats .st_mtime ):
2932
+ return HTTPResponse (status = 304 , ** headers )
2933
2933
2934
2934
body = '' if request .method == 'HEAD' else open (filename , 'rb' )
2935
2935
0 commit comments