File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
from abc import ABC , abstractmethod
2
2
from functools import cached_property
3
+ from os import PathLike
3
4
from typing import Any , Optional
5
+ from urllib .parse import quote
4
6
5
7
import requests
6
8
import requests_unixsocket
@@ -74,16 +76,16 @@ def render(
74
76
class SocketServerRenderer (ServerRenderer ):
75
77
"""Connect to a vue-ssr-service server via a UNIX socket."""
76
78
77
- def __init__ (self , socket : str ):
79
+ def __init__ (self , socket : PathLike | str ):
78
80
"""
79
81
:param socket: The path to the Unix socket.
80
82
"""
81
- self .unix_socket = socket
83
+ self .unix_socket = str ( socket )
82
84
self ._session = requests_unixsocket .Session ()
83
85
84
86
@cached_property
85
87
def address (self ) -> str :
86
- return f"http+unix://{ self .unix_socket } "
88
+ return f"http+unix://{ quote ( self .unix_socket , safe = '' ) } "
87
89
88
90
89
91
class ViteRenderer (SSRRenderer ):
You can’t perform that action at this time.
0 commit comments