Commit 78e520e
committed
feat(uri): #1996 groups G-1 and G-2 -- UriBuilder brackets an IPv6 host and lower-cases the scheme
setHostProperty("::1") rendered "http://::1/", which Uri rejects, and setSchemeProperty("HTTP")
kept "HTTP" and rendered "HTTP://...". Both now match .NET. #1996 splits into four independently
landable groups and names G-1 + G-2 the recommended minimum; both are alignments to the
reference, so SA-5 covers them. No signature, layout, vtable or noexcept change.
G-1 (UriBuilder.cs:167-197): the trigger is .NET's own -- the value must contain one of
s_hostReservedChars ":/\?#@[]" and then a ':' specifically, which .NET's comment calls a
"probable ipv6 address". An already-bracketed value is left alone.
G-2 (UriBuilder.cs:180): the setter ends in value.ToLowerInvariant(). Invariant means invariant,
so the fold is ASCII-only: std::tolower consults the global C locale, and a process that
installed a Turkish one would fold 'I' to a dotless 'i' and change what the scheme means -- the
hazard #2316 removed from CharUnicodeInfo.
ONE DELIBERATE DIVERGENCE, FORCED BY TAKING G-1 WITHOUT G-3. .NET's host setter WRAPS FIRST AND
THEN THROWS: "[::1" becomes "[[::1]" and is refused because the inside holds a '['
(:183-187). This group does not take the rejection -- #1996's own note reserves "a setter that
never threw starts throwing" for a group this is not -- and wrapping without rejecting would
leave the nonsense "[[::1]" stored, turning a value this port's Uri already refuses (#1991) into
one it might not. So a value already carrying a bracket is left exactly as given, and the reason
is at the site.
"h:abc" -> "[h:abc]" is NOT a divergence but .NET's own rule, and the port's Uri does not
validate a literal's content (plan 15.4), so that rendering now parses where "http://h:abc/" did
not. Two existing pins asserted the old unparseability; their subject is hash obtainability on an
unparseable rendering, which is now asserted on "[::1" and the empty host, both of which still
are.
G-3 -- which #1996 itself calls "the only narrowing" -- and G-4 are NOT taken and are pinned
absent by Decl1996_G3AndG4AreNotTakenAndStayPinned, so neither can be added without a decision.
setSchemeProperty("bad scheme") still stores it; setHostProperty("contoso.com/path") still stores
it; UriBuilder("www.example.com/path") still renders the measured form.
Mutations: 5, 4 caught. The uncaught one replaces the explicit ASCII fold with std::tolower and
is an EQUIVALENCE IN THE "C" LOCALE, which is the locale the test binary runs in -- the same case
#2174 recorded. Distinguishing them needs the global locale changed inside a shared binary, which
#2174 considered and declined for exactly this reason. The explicit fold is kept because the
guarantee is about what happens when a process DOES install another locale, which no test in this
binary can observe. The note is at the site.
Gate: 17,416 run, 17,416 passed, 0 failed, 0 skipped across 38 executables (+4, in
SharpRuntimeTests_Uri, 283 -> 287). Built in build/ with --parallel 2.
Downstream: zero UriBuilder sites in cna and mobile-eggbert.
docs/Migration-UriBuilderHostAndScheme.md1 parent f868593 commit 78e520e
5 files changed
Lines changed: 262 additions & 9 deletions
File tree
- docs
- modules/uri
- include/System
- tests/System
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
28 | 50 | | |
29 | 51 | | |
30 | 52 | | |
| |||
147 | 169 | | |
148 | 170 | | |
149 | 171 | | |
150 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
151 | 194 | | |
152 | 195 | | |
153 | 196 | | |
154 | 197 | | |
155 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
156 | 232 | | |
157 | 233 | | |
158 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | | - | |
280 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
281 | 288 | | |
282 | 289 | | |
283 | | - | |
| 290 | + | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
288 | 295 | | |
289 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
290 | 300 | | |
291 | 301 | | |
292 | 302 | | |
| |||
355 | 365 | | |
356 | 366 | | |
357 | 367 | | |
358 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
359 | 372 | | |
360 | 373 | | |
361 | 374 | | |
362 | | - | |
363 | 375 | | |
364 | 376 | | |
365 | 377 | | |
| |||
390 | 402 | | |
391 | 403 | | |
392 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
Binary file not shown.
0 commit comments