File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2236,6 +2236,8 @@ def determine_output_format(self, uri):
2236
2236
error
2237
2237
2238
2238
"""
2239
+ MAX_MIME_EXTENSION_LENGTH = 11 # application in /etc/mime.types
2240
+
2239
2241
# get the request format for response
2240
2242
# priority : extension from uri (/rest/data/issue.json)
2241
2243
# only json or xml valid at this time.
@@ -2248,11 +2250,12 @@ def determine_output_format(self, uri):
2248
2250
# such as .vcard for downloading user info can be
2249
2251
# supported. This method also allow detection of mistyped
2250
2252
# types like jon for json. Limit extension length to less than
2251
- # 10 characters to allow passing JWT via URL path. Could be
2252
- # useful for magic link login method or account recovery workflow,
2253
- # using a JWT with a short expiration time and limited rights
2254
- # (e.g. only password change permission))
2255
- if ext_type and (len (ext_type ) < 10 ):
2253
+ # MAX_MIME_EXTENSION_LENGTH characters to allow passing JWT
2254
+ # via URL path. Could be useful for magic link login method or
2255
+ # account recovery workflow, using a JWT with a short
2256
+ # expiration time and limited rights (e.g. only password
2257
+ # change permission))
2258
+ if ext_type and (len (ext_type ) < MAX_MIME_EXTENSION_LENGTH ):
2256
2259
if ext_type not in list (self .__accepted_content_type .values ()):
2257
2260
self .client .response_code = 406
2258
2261
return (None , uri ,
You can’t perform that action at this time.
0 commit comments