about summary refs log tree commit diff stats
path: root/adapter/protocol/data.nim
diff options
context:
space:
mode:
Diffstat (limited to 'adapter/protocol/data.nim')
-rw-r--r--adapter/protocol/data.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/adapter/protocol/data.nim b/adapter/protocol/data.nim
index 7b022976..4f5da2e8 100644
--- a/adapter/protocol/data.nim
+++ b/adapter/protocol/data.nim
@@ -2,15 +2,17 @@ import std/envvars
 import std/base64
 import std/strutils
 
+import loader/connecterror
 import utils/twtstr
 
 proc main() =
   let str = getEnv("MAPPED_URI_PATH")
   const si = "data:".len # start index
+  const iu = $int(ERROR_INVALID_URL)
   var ct = str.until(',', si)
   for c in ct:
     if c notin AsciiAlphaNumeric and c != '/':
-      stdout.write("Cha-Control: ConnectionError -7 invalid data URL")
+      stdout.write("Cha-Control: ConnectionError " & iu  & " invalid data URL")
       return
   let sd = si + ct.len + 1 # data start
   let body = percentDecode(str, sd)
@@ -21,7 +23,7 @@ proc main() =
       stdout.write("Content-Type: " & ct & "\n\n")
       stdout.write(d)
     except ValueError:
-      stdout.write("Cha-Control: ConnectionError -7 invalid data URL")
+      stdout.write("Cha-Control: ConnectionError " & iu  & " invalid data URL")
   else:
     stdout.write("Content-Type: " & ct & "\n\n")
     stdout.write(body)
the previous revision' href='/akspecs/ranger/blame/test/tc_ext.py?h=v1.2.2&id=64649898c66f8afb35e01eff8280e46d90fb73ae'>^
dc437e3b ^






64649898 ^
5a087b16 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144