Fix: Multipart file uploads with empty filename not detected as binary.
Signed-off-by: zhang-liang-pengkun <zhangliangpengkun@xfusion.com>
This commit is contained in:
parent
c69b35fb76
commit
4322cd7b03
@ -0,0 +1,32 @@
|
|||||||
|
From ed32f36b3feb8bbf1edaed4875b9820c9a71792e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Marcel Hellkamp <marc@gsites.de>
|
||||||
|
Date: Wed, 7 Jul 2021 13:02:33 +0200
|
||||||
|
Subject: [PATCH] Fix: Multipart file uploads with empty filename not detected
|
||||||
|
as binary.
|
||||||
|
|
||||||
|
---
|
||||||
|
bottle.py | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/bottle.py b/bottle.py
|
||||||
|
index 9806efd..406762f 100644
|
||||||
|
--- a/bottle.py
|
||||||
|
+++ b/bottle.py
|
||||||
|
@@ -1239,11 +1239,11 @@ class BaseRequest(object):
|
||||||
|
self['_cgi.FieldStorage'] = data #http://bugs.python.org/issue18394#msg207958
|
||||||
|
data = data.list or []
|
||||||
|
for item in data:
|
||||||
|
- if item.filename:
|
||||||
|
+ if item.filename is None:
|
||||||
|
+ post[item.name] = item.value
|
||||||
|
+ else:
|
||||||
|
post[item.name] = FileUpload(item.file, item.name,
|
||||||
|
item.filename, item.headers)
|
||||||
|
- else:
|
||||||
|
- post[item.name] = item.value
|
||||||
|
return post
|
||||||
|
|
||||||
|
@property
|
||||||
|
--
|
||||||
|
2.39.0.windows.2
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: python-bottle
|
Name: python-bottle
|
||||||
Version: 0.12.13
|
Version: 0.12.13
|
||||||
Release: 16
|
Release: 17
|
||||||
Summary: WSGI micro web-framework for Python.
|
Summary: WSGI micro web-framework for Python.
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://bottlepy.org
|
URL: http://bottlepy.org
|
||||||
@ -15,6 +15,7 @@ Patch0005: 0004-fix-1115-Some-modules-set-__file__-as-None.patch
|
|||||||
Patch0006: 0005-fix-1148-redirect-and-non-ascii-characters.patch
|
Patch0006: 0005-fix-1148-redirect-and-non-ascii-characters.patch
|
||||||
Patch0007: 0006-1177-Bug-fix-of-missing-regex-escaped-back-slashes.patch
|
Patch0007: 0006-1177-Bug-fix-of-missing-regex-escaped-back-slashes.patch
|
||||||
Patch0008: 0007-Fix-the-Allow-header-value-in-405-Method-not-allowed.patch
|
Patch0008: 0007-Fix-the-Allow-header-value-in-405-Method-not-allowed.patch
|
||||||
|
Patch0009: 0008-Fix-Multipart-file-uploads-with-empty-filename-not-d.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python2-devel python2-setuptools python3-devel python3-setuptools
|
BuildRequires: python2-devel python2-setuptools python3-devel python3-setuptools
|
||||||
|
|
||||||
@ -69,6 +70,9 @@ sed -i '/^#!/d' bottle.py
|
|||||||
%{python3_sitelib}/*
|
%{python3_sitelib}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 05 2024 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 0.12.13-17
|
||||||
|
- Fix: Multipart file uploads with empty filename not detected as binary.
|
||||||
|
|
||||||
* Fri Dec 29 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 0.12.13-16
|
* Fri Dec 29 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 0.12.13-16
|
||||||
- Fix the Allow: header value in 405 "Method not allowed." response.
|
- Fix the Allow: header value in 405 "Method not allowed." response.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user