WebHeaderCollection.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. //
  2. // System.Net.WebHeaderCollection
  3. //
  4. // Authors:
  5. // Lawrence Pit ([email protected])
  6. // Gonzalo Paniagua Javier ([email protected])
  7. // Miguel de Icaza ([email protected])
  8. //
  9. // Copyright 2003 Ximian, Inc. (http://www.ximian.com)
  10. // Copyright 2007 Novell, Inc. (http://www.novell.com)
  11. //
  12. //
  13. //
  14. // Permission is hereby granted, free of charge, to any person obtaining
  15. // a copy of this software and associated documentation files (the
  16. // "Software"), to deal in the Software without restriction, including
  17. // without limitation the rights to use, copy, modify, merge, publish,
  18. // distribute, sublicense, and/or sell copies of the Software, and to
  19. // permit persons to whom the Software is furnished to do so, subject to
  20. // the following conditions:
  21. //
  22. // The above copyright notice and this permission notice shall be
  23. // included in all copies or substantial portions of the Software.
  24. //
  25. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  29. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  30. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  31. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. //
  33. using System;
  34. using System.Collections;
  35. #if NET_2_0
  36. using System.Collections.Generic;
  37. #endif
  38. using System.Collections.Specialized;
  39. using System.Runtime.InteropServices;
  40. using System.Runtime.Serialization;
  41. using System.Text;
  42. // See RFC 2068 par 4.2 Message Headers
  43. namespace System.Net
  44. {
  45. [Serializable]
  46. [ComVisible(true)]
  47. public class WebHeaderCollection : NameValueCollection, ISerializable
  48. {
  49. private static readonly Hashtable restricted;
  50. private static readonly Hashtable multiValue;
  51. #if NET_2_0
  52. static readonly Dictionary<string, bool> restricted_response;
  53. #endif
  54. private bool internallyCreated = false;
  55. // Static Initializer
  56. static WebHeaderCollection ()
  57. {
  58. // the list of restricted header names as defined
  59. // by the ms.net spec
  60. restricted = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
  61. CaseInsensitiveComparer.DefaultInvariant);
  62. restricted.Add ("accept", true);
  63. restricted.Add ("connection", true);
  64. restricted.Add ("content-length", true);
  65. restricted.Add ("content-type", true);
  66. restricted.Add ("date", true);
  67. restricted.Add ("expect", true);
  68. restricted.Add ("host", true);
  69. restricted.Add ("if-modified-since", true);
  70. restricted.Add ("range", true);
  71. restricted.Add ("referer", true);
  72. restricted.Add ("transfer-encoding", true);
  73. restricted.Add ("user-agent", true);
  74. restricted.Add ("proxy-connection", true);
  75. //
  76. #if NET_2_0
  77. restricted_response = new Dictionary<string, bool> (StringComparer.InvariantCultureIgnoreCase);
  78. restricted_response.Add ("Content-Length", true);
  79. restricted_response.Add ("Transfer-Encoding", true);
  80. restricted_response.Add ("WWW-Authenticate", true);
  81. #endif
  82. // see par 14 of RFC 2068 to see which header names
  83. // accept multiple values each separated by a comma
  84. multiValue = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
  85. CaseInsensitiveComparer.DefaultInvariant);
  86. multiValue.Add ("accept", true);
  87. multiValue.Add ("accept-charset", true);
  88. multiValue.Add ("accept-encoding", true);
  89. multiValue.Add ("accept-language", true);
  90. multiValue.Add ("accept-ranges", true);
  91. multiValue.Add ("allow", true);
  92. multiValue.Add ("authorization", true);
  93. multiValue.Add ("cache-control", true);
  94. multiValue.Add ("connection", true);
  95. multiValue.Add ("content-encoding", true);
  96. multiValue.Add ("content-language", true);
  97. multiValue.Add ("expect", true);
  98. multiValue.Add ("if-match", true);
  99. multiValue.Add ("if-none-match", true);
  100. multiValue.Add ("proxy-authenticate", true);
  101. multiValue.Add ("public", true);
  102. multiValue.Add ("range", true);
  103. multiValue.Add ("transfer-encoding", true);
  104. multiValue.Add ("upgrade", true);
  105. multiValue.Add ("vary", true);
  106. multiValue.Add ("via", true);
  107. multiValue.Add ("warning", true);
  108. multiValue.Add ("www-authenticate", true);
  109. // Extra
  110. multiValue.Add ("set-cookie", true);
  111. multiValue.Add ("set-cookie2", true);
  112. }
  113. // Constructors
  114. public WebHeaderCollection () { }
  115. protected WebHeaderCollection (SerializationInfo serializationInfo,
  116. StreamingContext streamingContext)
  117. {
  118. int count;
  119. try {
  120. count = serializationInfo.GetInt32("Count");
  121. for (int i = 0; i < count; i++)
  122. this.Add (serializationInfo.GetString (i.ToString ()),
  123. serializationInfo.GetString ((count + i).ToString ()));
  124. } catch (SerializationException){
  125. count = serializationInfo.GetInt32("count");
  126. for (int i = 0; i < count; i++)
  127. this.Add (serializationInfo.GetString ("k" + i),
  128. serializationInfo.GetString ("v" + i));
  129. }
  130. }
  131. internal WebHeaderCollection (bool internallyCreated)
  132. {
  133. this.internallyCreated = internallyCreated;
  134. }
  135. // Methods
  136. public void Add (string header)
  137. {
  138. if (header == null)
  139. throw new ArgumentNullException ("header");
  140. int pos = header.IndexOf (':');
  141. if (pos == -1)
  142. throw new ArgumentException ("no colon found", "header");
  143. this.Add (header.Substring (0, pos),
  144. header.Substring (pos + 1));
  145. }
  146. public override void Add (string name, string value)
  147. {
  148. if (name == null)
  149. throw new ArgumentNullException ("name");
  150. if (internallyCreated && IsRestricted (name))
  151. throw new ArgumentException ("This header must be modified with the appropiate property.");
  152. this.AddWithoutValidate (name, value);
  153. }
  154. protected void AddWithoutValidate (string headerName, string headerValue)
  155. {
  156. if (!IsHeaderName (headerName))
  157. throw new ArgumentException ("invalid header name: " + headerName, "headerName");
  158. if (headerValue == null)
  159. headerValue = String.Empty;
  160. else
  161. headerValue = headerValue.Trim ();
  162. if (!IsHeaderValue (headerValue))
  163. throw new ArgumentException ("invalid header value: " + headerValue, "headerValue");
  164. base.Add (headerName, headerValue);
  165. }
  166. public override string [] GetValues (string header)
  167. {
  168. if (header == null)
  169. throw new ArgumentNullException ("header");
  170. string [] values = base.GetValues (header);
  171. if (values == null || values.Length == 0)
  172. return null;
  173. /*
  174. if (IsMultiValue (header)) {
  175. values = GetMultipleValues (values);
  176. }
  177. */
  178. return values;
  179. }
  180. public override string[] GetValues (int index)
  181. {
  182. string[] values = base.GetValues (index);
  183. if (values == null || values.Length == 0) {
  184. return(null);
  185. }
  186. return(values);
  187. }
  188. /* Now i wonder why this is here...
  189. static string [] GetMultipleValues (string [] values)
  190. {
  191. ArrayList mvalues = new ArrayList (values.Length);
  192. StringBuilder sb = null;
  193. for (int i = 0; i < values.Length; ++i) {
  194. string val = values [i];
  195. if (val.IndexOf (',') == -1) {
  196. mvalues.Add (val);
  197. continue;
  198. }
  199. if (sb == null)
  200. sb = new StringBuilder ();
  201. bool quote = false;
  202. for (int k = 0; k < val.Length; k++) {
  203. char c = val [k];
  204. if (c == '"') {
  205. quote = !quote;
  206. } else if (!quote && c == ',') {
  207. mvalues.Add (sb.ToString ().Trim ());
  208. sb.Length = 0;
  209. continue;
  210. }
  211. sb.Append (c);
  212. }
  213. if (sb.Length > 0) {
  214. mvalues.Add (sb.ToString ().Trim ());
  215. sb.Length = 0;
  216. }
  217. }
  218. return (string []) mvalues.ToArray (typeof (string));
  219. }
  220. */
  221. public static bool IsRestricted (string headerName)
  222. {
  223. if (headerName == null)
  224. throw new ArgumentNullException ("headerName");
  225. if (headerName == "") // MS throw nullexception here!
  226. throw new ArgumentException ("empty string", "headerName");
  227. if (!IsHeaderName (headerName))
  228. throw new ArgumentException ("Invalid character in header");
  229. return restricted.ContainsKey (headerName);
  230. }
  231. #if NET_2_0
  232. public static bool IsRestricted (string headerName, bool response)
  233. {
  234. if (String.IsNullOrEmpty (headerName))
  235. throw new ArgumentNullException ("headerName");
  236. if (!IsHeaderName (headerName))
  237. throw new ArgumentException ("Invalid character in header");
  238. if (response)
  239. return restricted_response.ContainsKey (headerName);
  240. return restricted.ContainsKey (headerName);
  241. }
  242. #endif
  243. public override void OnDeserialization (object sender)
  244. {
  245. }
  246. public override void Remove (string name)
  247. {
  248. if (name == null)
  249. throw new ArgumentNullException ("name");
  250. if (internallyCreated && IsRestricted (name))
  251. throw new ArgumentException ("restricted header");
  252. base.Remove (name);
  253. }
  254. public override void Set (string name, string value)
  255. {
  256. if (name == null)
  257. throw new ArgumentNullException ("name");
  258. if (internallyCreated && IsRestricted (name))
  259. throw new ArgumentException ("restricted header");
  260. if (!IsHeaderName (name))
  261. throw new ArgumentException ("invalid header name");
  262. if (value == null)
  263. value = String.Empty;
  264. else
  265. value = value.Trim ();
  266. if (!IsHeaderValue (value))
  267. throw new ArgumentException ("invalid header value");
  268. base.Set (name, value);
  269. }
  270. public byte[] ToByteArray ()
  271. {
  272. return Encoding.UTF8.GetBytes(ToString ());
  273. }
  274. public override string ToString ()
  275. {
  276. StringBuilder sb = new StringBuilder();
  277. int count = base.Count;
  278. for (int i = 0; i < count ; i++)
  279. sb.Append (GetKey (i))
  280. .Append (": ")
  281. .Append (Get (i))
  282. .Append ("\r\n");
  283. return sb.Append("\r\n").ToString();
  284. }
  285. #if !TARGET_JVM
  286. void ISerializable.GetObjectData (SerializationInfo serializationInfo,
  287. StreamingContext streamingContext)
  288. {
  289. GetObjectData (serializationInfo, streamingContext);
  290. }
  291. #endif
  292. public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
  293. {
  294. int count = base.Count;
  295. serializationInfo.AddValue ("Count", count);
  296. for (int i = 0; i < count; i++) {
  297. serializationInfo.AddValue (i.ToString (), GetKey (i));
  298. serializationInfo.AddValue ((count + i).ToString (), Get (i));
  299. }
  300. }
  301. public override string[] AllKeys
  302. {
  303. get {
  304. return(base.AllKeys);
  305. }
  306. }
  307. public override int Count
  308. {
  309. get {
  310. return(base.Count);
  311. }
  312. }
  313. public override KeysCollection Keys
  314. {
  315. get {
  316. return(base.Keys);
  317. }
  318. }
  319. public override string Get (int index)
  320. {
  321. return(base.Get (index));
  322. }
  323. public override string Get (string name)
  324. {
  325. return(base.Get (name));
  326. }
  327. public override string GetKey (int index)
  328. {
  329. return(base.GetKey (index));
  330. }
  331. #if NET_2_0
  332. public void Add (HttpRequestHeader header, string value)
  333. {
  334. Add (RequestHeaderToString (header), value);
  335. }
  336. public void Remove (HttpRequestHeader header)
  337. {
  338. Remove (RequestHeaderToString (header));
  339. }
  340. public void Set (HttpRequestHeader header, string value)
  341. {
  342. Set (RequestHeaderToString (header), value);
  343. }
  344. public void Add (HttpResponseHeader header, string value)
  345. {
  346. Add (ResponseHeaderToString (header), value);
  347. }
  348. public void Remove (HttpResponseHeader header)
  349. {
  350. Remove (ResponseHeaderToString (header));
  351. }
  352. public void Set (HttpResponseHeader header, string value)
  353. {
  354. Set (ResponseHeaderToString (header), value);
  355. }
  356. string RequestHeaderToString (HttpRequestHeader value)
  357. {
  358. switch (value){
  359. case HttpRequestHeader.CacheControl:
  360. return "Cache-Control";
  361. case HttpRequestHeader.Connection:
  362. return "Connection";
  363. case HttpRequestHeader.Date:
  364. return "Date";
  365. case HttpRequestHeader.KeepAlive:
  366. return "Keep-Alive";
  367. case HttpRequestHeader.Pragma:
  368. return "Pragma";
  369. case HttpRequestHeader.Trailer:
  370. return "Trailer";
  371. case HttpRequestHeader.TransferEncoding:
  372. return "Transfer-Encoding";
  373. case HttpRequestHeader.Upgrade:
  374. return "Upgrade";
  375. case HttpRequestHeader.Via:
  376. return "Via";
  377. case HttpRequestHeader.Warning:
  378. return "Warning";
  379. case HttpRequestHeader.Allow:
  380. return "Allow";
  381. case HttpRequestHeader.ContentLength:
  382. return "Content-Length";
  383. case HttpRequestHeader.ContentType:
  384. return "Content-Type";
  385. case HttpRequestHeader.ContentEncoding:
  386. return "Content-Encoding";
  387. case HttpRequestHeader.ContentLanguage:
  388. return "Content-Language";
  389. case HttpRequestHeader.ContentLocation:
  390. return "Content-Location";
  391. case HttpRequestHeader.ContentMd5:
  392. return "Content-MD5";
  393. case HttpRequestHeader.ContentRange:
  394. return "Content-Range";
  395. case HttpRequestHeader.Expires:
  396. return "Expires";
  397. case HttpRequestHeader.LastModified:
  398. return "Last-Modified";
  399. case HttpRequestHeader.Accept:
  400. return "Accept";
  401. case HttpRequestHeader.AcceptCharset:
  402. return "Accept-Charset";
  403. case HttpRequestHeader.AcceptEncoding:
  404. return "Accept-Encoding";
  405. case HttpRequestHeader.AcceptLanguage:
  406. return "accept-language";
  407. case HttpRequestHeader.Authorization:
  408. return "Authorization";
  409. case HttpRequestHeader.Cookie:
  410. return "Cookie";
  411. case HttpRequestHeader.Expect:
  412. return "Expect";
  413. case HttpRequestHeader.From:
  414. return "From";
  415. case HttpRequestHeader.Host:
  416. return "Host";
  417. case HttpRequestHeader.IfMatch:
  418. return "If-Match";
  419. case HttpRequestHeader.IfModifiedSince:
  420. return "If-Modified-Since";
  421. case HttpRequestHeader.IfNoneMatch:
  422. return "If-None-Match";
  423. case HttpRequestHeader.IfRange:
  424. return "If-Range";
  425. case HttpRequestHeader.IfUnmodifiedSince:
  426. return "If-Unmodified-Since";
  427. case HttpRequestHeader.MaxForwards:
  428. return "Max-Forwards";
  429. case HttpRequestHeader.ProxyAuthorization:
  430. return "Proxy-Authorization";
  431. case HttpRequestHeader.Referer:
  432. return "Referer";
  433. case HttpRequestHeader.Range:
  434. return "Range";
  435. case HttpRequestHeader.Te:
  436. return "TE";
  437. case HttpRequestHeader.Translate:
  438. return "Translate";
  439. case HttpRequestHeader.UserAgent:
  440. return "User-Agent";
  441. default:
  442. throw new InvalidOperationException ();
  443. }
  444. }
  445. public string this[HttpRequestHeader hrh]
  446. {
  447. get {
  448. return Get (RequestHeaderToString (hrh));
  449. }
  450. set {
  451. Add (RequestHeaderToString (hrh), value);
  452. }
  453. }
  454. string ResponseHeaderToString (HttpResponseHeader value)
  455. {
  456. switch (value){
  457. case HttpResponseHeader.CacheControl:
  458. return "Cache-Control";
  459. case HttpResponseHeader.Connection:
  460. return "Connection";
  461. case HttpResponseHeader.Date:
  462. return "Date";
  463. case HttpResponseHeader.KeepAlive:
  464. return "Keep-Alive";
  465. case HttpResponseHeader.Pragma:
  466. return "Pragma";
  467. case HttpResponseHeader.Trailer:
  468. return "Trailer";
  469. case HttpResponseHeader.TransferEncoding:
  470. return "Transfer-Encoding";
  471. case HttpResponseHeader.Upgrade:
  472. return "Upgrade";
  473. case HttpResponseHeader.Via:
  474. return "Via";
  475. case HttpResponseHeader.Warning:
  476. return "Warning";
  477. case HttpResponseHeader.Allow:
  478. return "Allow";
  479. case HttpResponseHeader.ContentLength:
  480. return "Content-Length";
  481. case HttpResponseHeader.ContentType:
  482. return "Content-Type";
  483. case HttpResponseHeader.ContentEncoding:
  484. return "Content-Encoding";
  485. case HttpResponseHeader.ContentLanguage:
  486. return "Content-Language";
  487. case HttpResponseHeader.ContentLocation:
  488. return "Content-Location";
  489. case HttpResponseHeader.ContentMd5:
  490. return "Content-MD5";
  491. case HttpResponseHeader.ContentRange:
  492. return "Content-Range";
  493. case HttpResponseHeader.Expires:
  494. return "Expires";
  495. case HttpResponseHeader.LastModified:
  496. return "Last-Modified";
  497. case HttpResponseHeader.AcceptRanges:
  498. return "Accept-Ranges";
  499. case HttpResponseHeader.Age:
  500. return "Age";
  501. case HttpResponseHeader.ETag:
  502. return "ETag";
  503. case HttpResponseHeader.Location:
  504. return "Location";
  505. case HttpResponseHeader.ProxyAuthenticate:
  506. return "Proxy-Authenticate";
  507. case HttpResponseHeader.RetryAfter:
  508. return "Retry-After";
  509. case HttpResponseHeader.Server:
  510. return "Server";
  511. case HttpResponseHeader.SetCookie:
  512. return "Set-Cookie";
  513. case HttpResponseHeader.Vary:
  514. return "Vary";
  515. case HttpResponseHeader.WwwAuthenticate:
  516. return "WWW-Authenticate";
  517. default:
  518. throw new InvalidOperationException ();
  519. }
  520. }
  521. public string this[HttpResponseHeader hrh]
  522. {
  523. get
  524. {
  525. return Get (ResponseHeaderToString (hrh));
  526. }
  527. set
  528. {
  529. Add (ResponseHeaderToString (hrh), value);
  530. }
  531. }
  532. public override void Clear ()
  533. {
  534. base.Clear ();
  535. }
  536. public override IEnumerator GetEnumerator ()
  537. {
  538. return(base.GetEnumerator ());
  539. }
  540. #endif
  541. // Internal Methods
  542. // With this we don't check for invalid characters in header. See bug #55994.
  543. internal void SetInternal (string header)
  544. {
  545. int pos = header.IndexOf (':');
  546. if (pos == -1)
  547. throw new ArgumentException ("no colon found", "header");
  548. SetInternal (header.Substring (0, pos), header.Substring (pos + 1));
  549. }
  550. internal void SetInternal (string name, string value)
  551. {
  552. if (value == null)
  553. value = String.Empty;
  554. else
  555. value = value.Trim ();
  556. if (!IsHeaderValue (value))
  557. throw new ArgumentException ("invalid header value");
  558. if (IsMultiValue (name)) {
  559. base.Add (name, value);
  560. } else {
  561. base.Remove (name);
  562. base.Set (name, value);
  563. }
  564. }
  565. internal void RemoveAndAdd (string name, string value)
  566. {
  567. if (value == null)
  568. value = String.Empty;
  569. else
  570. value = value.Trim ();
  571. base.Remove (name);
  572. base.Set (name, value);
  573. }
  574. internal void RemoveInternal (string name)
  575. {
  576. if (name == null)
  577. throw new ArgumentNullException ("name");
  578. base.Remove (name);
  579. }
  580. // Private Methods
  581. internal static bool IsMultiValue (string headerName)
  582. {
  583. if (headerName == null || headerName == "")
  584. return false;
  585. return multiValue.ContainsKey (headerName);
  586. }
  587. internal static bool IsHeaderValue (string value)
  588. {
  589. // TEXT any 8 bit value except CTL's (0-31 and 127)
  590. // but including \r\n space and \t
  591. // after a newline at least one space or \t must follow
  592. // certain header fields allow comments ()
  593. int len = value.Length;
  594. for (int i = 0; i < len; i++) {
  595. char c = value [i];
  596. if (c == 127)
  597. return false;
  598. if (c < 0x20 && (c != '\r' && c != '\n' && c != '\t'))
  599. return false;
  600. if (c == '\n' && ++i < len) {
  601. c = value [i];
  602. if (c != ' ' && c != '\t')
  603. return false;
  604. }
  605. }
  606. return true;
  607. }
  608. internal static bool IsHeaderName (string name)
  609. {
  610. if (name == null || name.Length == 0)
  611. return false;
  612. int len = name.Length;
  613. for (int i = 0; i < len; i++) {
  614. char c = name [i];
  615. if (c > 126 || !allowed_chars [(int) c])
  616. return false;
  617. }
  618. return true;
  619. }
  620. static bool [] allowed_chars = new bool [126] {
  621. false, false, false, false, false, false, false, false, false, false, false, false, false, false,
  622. false, false, false, false, false, false, false, false, false, false, false, false, false, false,
  623. false, false, false, false, false, true, false, true, true, true, true, false, false, false, true,
  624. true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false,
  625. false, false, false, false, false, false, true, true, true, true, true, true, true, true, true,
  626. true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
  627. false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true,
  628. true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
  629. false, true, false
  630. };
  631. }
  632. }