File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,12 @@ server {
6565 -- Keep safe ASCII characters as is
6666 encoded = encoded .. string.char(byte)
6767 else
68- -- For all other bytes, use the -XX format
69- encoded = encoded .. "-" .. string.format("%02x", byte):lower()
68+ -- For all other bytes except the first one, use the -XX format
69+ if #encoded > 0 then
70+ encoded = encoded .. "-" .. string.format("%02x", byte):lower()
71+ else
72+ encoded = encoded .. string.format("%02x", byte):lower()
73+ end
7074 end
7175 end
7276 table.insert(encoded_parts, encoded)
Original file line number Diff line number Diff line change @@ -124,8 +124,12 @@ server {
124124 -- Keep safe ASCII characters as is
125125 encoded = encoded .. string.char(byte)
126126 else
127- -- For all other bytes, use the -XX format
128- encoded = encoded .. "-" .. string.format("%02x", byte):lower()
127+ -- For all other bytes except the first one, use the -XX format
128+ if #encoded > 0 then
129+ encoded = encoded .. "-" .. string.format("%02x", byte):lower()
130+ else
131+ encoded = encoded .. string.format("%02x", byte):lower()
132+ end
129133 end
130134 end
131135 table.insert(encoded_parts, encoded)
You can’t perform that action at this time.
0 commit comments