txhttputil 1.2.13__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {txhttputil-1.2.13/txhttputil.egg-info → txhttputil-1.3.0}/PKG-INFO +9 -1
  2. {txhttputil-1.2.13 → txhttputil-1.3.0}/pyproject.toml +1 -1
  3. txhttputil-1.3.0/txhttputil/__init__.py +3 -0
  4. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/FileUploadRequest.py +11 -2
  5. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/StaticFileResource.py +4 -0
  6. {txhttputil-1.2.13 → txhttputil-1.3.0/txhttputil.egg-info}/PKG-INFO +9 -1
  7. txhttputil-1.2.13/txhttputil/__init__.py +0 -3
  8. {txhttputil-1.2.13 → txhttputil-1.3.0}/LICENSE +0 -0
  9. {txhttputil-1.2.13 → txhttputil-1.3.0}/README.md +0 -0
  10. {txhttputil-1.2.13 → txhttputil-1.3.0}/setup.cfg +0 -0
  11. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/downloader/HttpFileDownloader.py +0 -0
  12. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/downloader/HttpResourceProxy.py +0 -0
  13. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/downloader/__init__.py +0 -0
  14. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/login_page/LoginElement.py +0 -0
  15. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/login_page/LoginTemplate.xml +0 -0
  16. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/login_page/__init__.py +0 -0
  17. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/AuthCredentials.py +0 -0
  18. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/AuthResource.py +0 -0
  19. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/AuthSessionWrapper.py +0 -0
  20. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/AuthUserDetails.py +0 -0
  21. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/BasicResource.py +0 -0
  22. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/FileUnderlayResource.py +0 -0
  23. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/FileUnderlayResourceTest.py +0 -0
  24. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/RedirectToHttpsResource.py +0 -0
  25. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/RedirectionRule.py +0 -0
  26. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/ResourceCreator.py +0 -0
  27. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/RootResource.py +0 -0
  28. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/RootSiteTest.py +0 -0
  29. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/SiteUtil.py +0 -0
  30. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/site/__init__.py +0 -0
  31. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/util/DeferUtil.py +0 -0
  32. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/util/ModuleUtil.py +0 -0
  33. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/util/PemUtil.py +0 -0
  34. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/util/SslUtil.py +0 -0
  35. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil/util/__init__.py +0 -0
  36. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil.egg-info/SOURCES.txt +0 -0
  37. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil.egg-info/dependency_links.txt +0 -0
  38. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil.egg-info/requires.txt +0 -0
  39. {txhttputil-1.2.13 → txhttputil-1.3.0}/txhttputil.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: txhttputil
3
- Version: 1.2.13
3
+ Version: 1.3.0
4
4
  Summary: Synerty utility classes for serving a static site with twisted.web with user permissions.
5
5
  Author-email: Synerty <contact@synerty.com>
6
6
  Project-URL: Homepage, https://github.com/Synerty/txhttputil
@@ -8,3 +8,11 @@ Project-URL: Download, https://github.com/Synerty/txhttputil/tarball/1.2.11
8
8
  Keywords: twisted,resource,file,download,synerty
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  License-File: LICENSE
11
+ Requires-Dist: pytz
12
+ Requires-Dist: txwebsocket>=1.0.1
13
+ Requires-Dist: filetype
14
+ Requires-Dist: pem
15
+ Requires-Dist: pytmpdir
16
+ Requires-Dist: treelib>=1.6.4
17
+ Requires-Dist: cryptography
18
+ Requires-Dist: pyOpenSSL
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "txhttputil"
7
- version = "1.2.13"
7
+ version = "1.3.0"
8
8
  authors = [{name = "Synerty", email = "contact@synerty.com"}]
9
9
  description = "Synerty utility classes for serving a static site with twisted.web with user permissions."
10
10
  keywords = [
@@ -0,0 +1,3 @@
1
+
2
+
3
+ __version__ = '1.3.0'
@@ -10,7 +10,6 @@ import logging
10
10
  import os
11
11
  from urllib.parse import parse_qs
12
12
 
13
- from twisted.web.http import _parseHeader
14
13
 
15
14
  from pytmpdir.spooled_named_temporary_file import (
16
15
  SpooledNamedTemporaryFile,
@@ -95,7 +94,7 @@ class FileUploadRequest(server.Request):
95
94
 
96
95
  if self.method == b"POST" and ctype and clength:
97
96
  mfd = b"multipart/form-data"
98
- key, pdict = _parseHeader(ctype)
97
+ key, pdict = self._parseHeader(ctype)
99
98
  # This weird CONTENT-LENGTH param is required by
100
99
  # cgi.parse_multipart() in some versions of Python 3.7+, see
101
100
  # bpo-29979. It looks like this will be relaxed and backported, see
@@ -241,3 +240,13 @@ class FileUploadRequest(server.Request):
241
240
 
242
241
  fp.seek(rewind) # restore cursor
243
242
  return partdict
243
+
244
+ def _parseHeader(self, line):
245
+ # cgi.parse_header requires a str
246
+ key, pdict = cgi.parse_header(line.decode("charmap"))
247
+
248
+ # We want the key as bytes, and cgi.parse_multipart (which consumes
249
+ # pdict) expects a dict of str keys but bytes values
250
+ key = key.encode("charmap")
251
+ pdict = {x: y.encode("charmap") for x, y in pdict.items()}
252
+ return (key, pdict)
@@ -62,6 +62,10 @@ class StaticFileResource(BasicResource):
62
62
  pathname2url(filePath), strict=False
63
63
  )[0]
64
64
 
65
+ if self._mimetype is None:
66
+ # fallback to arbitrary binary data
67
+ self._mimetype = "application/octet-stream"
68
+
65
69
  assert self._mimetype, "Unknown mime type for: %s" % filePath
66
70
 
67
71
  def render_GET(self, request):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: txhttputil
3
- Version: 1.2.13
3
+ Version: 1.3.0
4
4
  Summary: Synerty utility classes for serving a static site with twisted.web with user permissions.
5
5
  Author-email: Synerty <contact@synerty.com>
6
6
  Project-URL: Homepage, https://github.com/Synerty/txhttputil
@@ -8,3 +8,11 @@ Project-URL: Download, https://github.com/Synerty/txhttputil/tarball/1.2.11
8
8
  Keywords: twisted,resource,file,download,synerty
9
9
  Classifier: Programming Language :: Python :: 3.9
10
10
  License-File: LICENSE
11
+ Requires-Dist: pytz
12
+ Requires-Dist: txwebsocket>=1.0.1
13
+ Requires-Dist: filetype
14
+ Requires-Dist: pem
15
+ Requires-Dist: pytmpdir
16
+ Requires-Dist: treelib>=1.6.4
17
+ Requires-Dist: cryptography
18
+ Requires-Dist: pyOpenSSL
@@ -1,3 +0,0 @@
1
-
2
-
3
- __version__ = '1.2.13'
File without changes
File without changes
File without changes