litestar-vite 0.2.4__py3-none-any.whl → 0.2.5__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.

Potentially problematic release.


This version of litestar-vite might be problematic. Click here for more details.

@@ -7,7 +7,7 @@ from mimetypes import guess_type
7
7
  from pathlib import PurePath
8
8
  from textwrap import dedent
9
9
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, TypeVar, cast
10
- from urllib.parse import quote
10
+ from urllib.parse import quote, urlparse
11
11
 
12
12
  from litestar import Litestar, MediaType, Request, Response
13
13
  from litestar.datastructures.cookie import Cookie
@@ -335,6 +335,8 @@ class InertiaRedirect(Redirect):
335
335
  """Initialize external redirect, Set status code to 409 (required by Inertia),
336
336
  and pass redirect url.
337
337
  """
338
+ referer = urlparse(request.headers.get("referer", str(request.base_url)))
339
+ redirect_to = str(urlparse(redirect_to)._replace(scheme=referer.scheme))
338
340
  super().__init__(
339
341
  path=redirect_to,
340
342
  status_code=HTTP_307_TEMPORARY_REDIRECT if request.method == "GET" else HTTP_303_SEE_OTHER,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: litestar-vite
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Vite plugin for Litestar
5
5
  Project-URL: Changelog, https://cofin.github.io/litestar-vite/latest/changelog
6
6
  Project-URL: Discord, https://discord.gg/X3FJqy8d2j
@@ -14,7 +14,7 @@ litestar_vite/inertia/exception_handler.py,sha256=HrFa8in0wF9V5PuctG3flIrhhEPsWU
14
14
  litestar_vite/inertia/middleware.py,sha256=NEDcAoT7GMWA9hEGvANZ3MG5_p3MmZX57RF95T71les,1716
15
15
  litestar_vite/inertia/plugin.py,sha256=ebAG9XnDBahttuc7WIUgBd3o_Ys8MdPS273LPNs5H8A,2344
16
16
  litestar_vite/inertia/request.py,sha256=hk8m1pmDiMbWhVurRDHfDPD24nMHp56JzUKV6SBDeqA,3665
17
- litestar_vite/inertia/response.py,sha256=xaMm1KQllLmtRqoS7onf_pvIiwKz9P_POx_l01xjL28,15693
17
+ litestar_vite/inertia/response.py,sha256=cWpLU07sHcty_f9-j9qwPymnU_h8gNz23zKMCZ8Tqg4,15866
18
18
  litestar_vite/inertia/routes.py,sha256=QksJm2RUfL-WbuhOieYnPXXWO5GYnPtmsYEm6Ef8Yeo,1782
19
19
  litestar_vite/inertia/types.py,sha256=tLp0pm1N__hcWC875khf6wH1nuFlKS9-VjDqgsRkXnw,702
20
20
  litestar_vite/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -24,7 +24,7 @@ litestar_vite/templates/package.json.j2,sha256=0JWgdTuaSZ25EmCltF_zbqDdpxfvCLeYu
24
24
  litestar_vite/templates/styles.css.j2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  litestar_vite/templates/tsconfig.json.j2,sha256=q1REIuVyXUHCy4Zi2kgTkmrhdT98vyY89k-WTrImOj8,843
26
26
  litestar_vite/templates/vite.config.ts.j2,sha256=FZ4OJaB8Kjby_nlx4_LCP8eCe1LRi8kW2GspCiVMfDY,1115
27
- litestar_vite-0.2.4.dist-info/METADATA,sha256=mYw52i0mueXhTjlZChQpedxUeQdeAnyZtvlvwFIa-8M,6180
28
- litestar_vite-0.2.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
29
- litestar_vite-0.2.4.dist-info/licenses/LICENSE,sha256=HeTiEfEgvroUXZe_xAmYHxtTBgw--mbXyZLsWDYabHc,1069
30
- litestar_vite-0.2.4.dist-info/RECORD,,
27
+ litestar_vite-0.2.5.dist-info/METADATA,sha256=aUXrSGZZV-NDdqiCANvOkt9WQ5ZVLERTflwpXJPJljU,6180
28
+ litestar_vite-0.2.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
29
+ litestar_vite-0.2.5.dist-info/licenses/LICENSE,sha256=HeTiEfEgvroUXZe_xAmYHxtTBgw--mbXyZLsWDYabHc,1069
30
+ litestar_vite-0.2.5.dist-info/RECORD,,