Debian Codegraph @

crt/aws-c-sdkutils/tests/resources/test-cases/parse-url.json

raw symbols SCIP
1 {
2 "version": "1.0",
3 "testCases": [
4 {
5 "documentation": "simple URL parsing",
6 "params": {
7 "Endpoint": "https://authority.com/custom-path"
8 },
9 "expect": {
10 "endpoint": {
11 "url": "https://https-authority.com.example.com/path-is/custom-path"
12 }
13 }
14 },
15 {
16 "documentation": "empty path no slash",
17 "params": {
18 "Endpoint": "https://authority.com"
19 },
20 "expect": {
21 "endpoint": {
22 "url": "https://https-authority.com-nopath.example.com"
23 }
24 }
25 },
26 {
27 "documentation": "empty path with slash",
28 "params": {
29 "Endpoint": "https://authority.com/"
30 },
31 "expect": {
32 "endpoint": {
33 "url": "https://https-authority.com-nopath.example.com"
34 }
35 }
36 },
37 {
38 "documentation": "authority with port",
39 "params": {
40 "Endpoint": "https://authority.com:8000/port"
41 },
42 "expect": {
43 "endpoint": {
44 "url": "https://authority.com:8000/uri-with-port"
45 }
46 }
47 },
48 {
49 "documentation": "http schemes",
50 "params": {
51 "Endpoint": "http://authority.com:8000/port"
52 },
53 "expect": {
54 "endpoint": {
55 "url": "http://authority.com:8000/uri-with-port"
56 }
57 }
58 },
59 {
60 "documentation": "arbitrary schemes are not supported",
61 "params": {
62 "Endpoint": "acbd://example.com"
63 },
64 "expect": {
65 "error": "endpoint was invalid"
66 }
67 },
68 {
69 "documentation": "host labels are not validated",
70 "params": {
71 "Endpoint": "http://99_ab.com"
72 },
73 "expect": {
74 "endpoint": {
75 "url": "https://http-99_ab.com-nopath.example.com"
76 }
77 }
78 },
79 {
80 "documentation": "host labels are not validated",
81 "params": {
82 "Endpoint": "http://99_ab-.com"
83 },
84 "expect": {
85 "endpoint": {
86 "url": "https://http-99_ab-.com-nopath.example.com"
87 }
88 }
89 },
90 {
91 "documentation": "invalid URL",
92 "params": {
93 "Endpoint": "http://abc.com:a/foo"
94 },
95 "expect": {
96 "error": "endpoint was invalid"
97 }
98 },
99 {
100 "documentation": "IP Address",
101 "params": {
102 "Endpoint": "http://192.168.1.1/foo/"
103 },
104 "expect": {
105 "endpoint": {
106 "url": "http://192.168.1.1/foo/is-ip-addr"
107 }
108 }
109 },
110 {
111 "documentation": "IP Address with port",
112 "params": {
113 "Endpoint": "http://192.168.1.1:1234/foo/"
114 },
115 "expect": {
116 "endpoint": {
117 "url": "http://192.168.1.1:1234/foo/is-ip-addr"
118 }
119 }
120 },
121 {
122 "documentation": "IPv6 Address",
123 "params": {
124 "Endpoint": "https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443"
125 },
126 "expect": {
127 "endpoint": {
128 "url": "https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443/is-ip-addr"
129 }
130 }
131 },
132 {
133 "documentation": "weird DNS name",
134 "params": {
135 "Endpoint": "https://999.999.abc.blah"
136 },
137 "expect": {
138 "endpoint": {
139 "url": "https://https-999.999.abc.blah-nopath.example.com"
140 }
141 }
142 },
143 {
144 "documentation": "query in resolved endpoint is not supported",
145 "params": {
146 "Endpoint": "https://example.com/path?query1=foo"
147 },
148 "expect": {
149 "error": "endpoint was invalid"
150 }
151 }
152 ]
153 }