plain 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl

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.
plain/assets/views.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import functools
2
+ import mimetypes
2
3
  import os
3
4
  from email.utils import formatdate, parsedate
4
5
  from io import BytesIO
@@ -53,9 +54,12 @@ class AssetView(View):
53
54
  if not_modified_response := self.get_conditional_response(absolute_path):
54
55
  return not_modified_response
55
56
 
57
+ content_type, _ = mimetypes.guess_type(absolute_path)
58
+
56
59
  response = FileResponse(
57
60
  open(absolute_path, "rb"),
58
- filename=os.path.basename(absolute_path), # Used for Content-Type
61
+ filename=os.path.basename(absolute_path),
62
+ content_type=content_type,
59
63
  )
60
64
  response.headers = self.update_headers(response.headers, absolute_path)
61
65
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plain
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A web framework for building products with Python.
5
5
  Author: Dave Gaeddert
6
6
  Author-email: dave.gaeddert@dropseed.dev
@@ -6,7 +6,7 @@ plain/assets/compile.py,sha256=lsnciN85YjHe6d8VIKJi1L8r7NGHNzMOe9L87wObM5I,3287
6
6
  plain/assets/finders.py,sha256=WEKAnXTmpuQ7UKLZz7vHPrKFdDOkuZSP6_JTKmIxrKg,1268
7
7
  plain/assets/fingerprints.py,sha256=1NKAnnXVlncY5iimXztr0NL3RIjBKsNlZRIe6nmItJc,931
8
8
  plain/assets/urls.py,sha256=ZTIoM1Zq35JaXZ3wFhXhfGa7VoITDNlH9i5RS0R5xow,933
9
- plain/assets/views.py,sha256=BabrNgBAs5UqVAuaC47SFF3Ocq30ut2OoS9911FIeA4,8826
9
+ plain/assets/views.py,sha256=iVJEmXEDeud94z86OCtWLgMRTY3j6CIxaqHiAT7Ogls,8920
10
10
  plain/cli/README.md,sha256=bEp9B9C92YEa44wN2IywTmNZsYBv_uGq9AS_bBiAGdY,2580
11
11
  plain/cli/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
12
12
  plain/cli/cli.py,sha256=JyPNQGlczqCyLxZq5Jh_591rKpBMN91JHGXdaTuPWJ0,14841
@@ -152,8 +152,8 @@ plain/views/objects.py,sha256=9QBYyb8PgkRirXCQ8-Pms4_yMzP37dfeL30hWRYmtZg,7909
152
152
  plain/views/redirect.py,sha256=KLnlktzK6ZNMTlaEiZpMKQMEP5zeTgGLJ9BIkIJfwBo,1733
153
153
  plain/views/templates.py,sha256=nF9CcdhhjAyp3LB0RrSYnBaHpHzMfPSw719RCdcXk7o,2007
154
154
  plain/wsgi.py,sha256=R6k5FiAElvGDApEbMPTT0MPqSD7n2e2Az5chQqJZU0I,236
155
- plain-0.2.3.dist-info/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
156
- plain-0.2.3.dist-info/METADATA,sha256=dvGFe3NkdchsGoroE3XfePr1xytqe6OnlMArM_7grWA,2716
157
- plain-0.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
158
- plain-0.2.3.dist-info/entry_points.txt,sha256=7O1RZTmMasKYB73bfqQcTwIhsXo7RjEIKv2WbtTtOIM,39
159
- plain-0.2.3.dist-info/RECORD,,
155
+ plain-0.2.4.dist-info/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
156
+ plain-0.2.4.dist-info/METADATA,sha256=jIUR5xsnJL-whX8iOKzKbvkOhWsQGurVk6_gJEyDJ3g,2716
157
+ plain-0.2.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
158
+ plain-0.2.4.dist-info/entry_points.txt,sha256=7O1RZTmMasKYB73bfqQcTwIhsXo7RjEIKv2WbtTtOIM,39
159
+ plain-0.2.4.dist-info/RECORD,,
File without changes
File without changes