Skip to content

Commit d121b1b

Browse files
committed
Handle non-ascii characters
1 parent dadc9e8 commit d121b1b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

LinkIPFSPlugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import re
33
import gevent
44
import html
5+
import socket
56

67
from Plugin import PluginManager
78
from Config import config
@@ -15,9 +16,9 @@
1516
class UiRequestPlugin(object):
1617
def actionWrapper(self, path, extra_headers=None):
1718
if path.startswith("/ipfs/") or path.startswith("/ipns/"):
18-
local_url = "http://127.0.0.1:8080%s" % (path)
19-
gateway_url = "https://ipfs.io%s" % (path)
19+
local_url = "http://127.0.0.1:8080%s" % (quote(path))
2020
local_timeout = 3
21+
gateway_url = "https://ipfs.io%s" % (quote(path))
2122
try:
2223
request = Request(local_url)
2324
response = urlopen(request, timeout=local_timeout)

0 commit comments

Comments
 (0)