Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsLocalDomain()

bool System.Net.CookieContainer.IsLocalDomain ( string host)
inlinepackage

Definition at line 424 of file CookieContainer.cs.

425 {
426 int num = host.IndexOf('.');
427 if (num == -1)
428 {
429 return true;
430 }
431 switch (host)
432 {
433 case "127.0.0.1":
434 case "::1":
435 case "0:0:0:0:0:0:0:1":
436 return true;
437 default:
438 {
439 if (string.Compare(m_fqdnMyDomain, 0, host, num, m_fqdnMyDomain.Length, StringComparison.OrdinalIgnoreCase) == 0)
440 {
441 return true;
442 }
443 string[] array = host.Split('.');
444 if (array != null && array.Length == 4 && array[0] == "127")
445 {
446 int i;
447 for (i = 1; i < array.Length; i++)
448 {
449 string text = array[i];
450 switch (text.Length)
451 {
452 case 3:
453 if (text[2] < '0' || text[2] > '9')
454 {
455 break;
456 }
457 goto case 2;
458 case 2:
459 if (text[1] < '0' || text[1] > '9')
460 {
461 break;
462 }
463 goto case 1;
464 case 1:
465 if (text[0] >= '0' && text[0] <= '9')
466 {
467 continue;
468 }
469 break;
470 }
471 break;
472 }
473 if (i == 4)
474 {
475 return true;
476 }
477 }
478 return false;
479 }
480 }
481 }

References System.array, System.Net.CookieContainer.m_fqdnMyDomain, and System.text.

Referenced by System.Net.CookieContainer.Add(), System.Net.CookieContainer.Add(), System.Net.CookieContainer.Add(), and System.Net.CookieContainer.CookieCutter().