/lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-May/026220.html

https://github.com/whatwg/whatwg.org · HTML · 96 lines · 69 code · 20 blank · 7 comment · 0 complexity · 05ee1fc757fa9cfd0132e459a68bf4c1 MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE> [whatwg] WebSocket handshake: 0x0D in first &quot;line&quot;
  5. </TITLE>
  6. <LINK REL="Index" HREF="index.html" >
  7. <LINK REL="made" HREF="mailto:whatwg%40lists.whatwg.org?Subject=Re%3A%20%5Bwhatwg%5D%20WebSocket%20handshake%3A%200x0D%20in%20first%20%22line%22&In-Reply-To=%3Cop.vcbxqq16idj3kv%40simon-pieterss-macbook.local%3E">
  8. <META NAME="robots" CONTENT="index,nofollow">
  9. <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
  10. <LINK REL="Previous" HREF="026400.html">
  11. <LINK REL="Next" HREF="026221.html">
  12. </HEAD>
  13. <BODY BGCOLOR="#ffffff">
  14. <H1>[whatwg] WebSocket handshake: 0x0D in first &quot;line&quot;</H1>
  15. <!--htdig_noindex-->
  16. <B>Simon Pieters</B>
  17. <A HREF="mailto:whatwg%40lists.whatwg.org?Subject=Re%3A%20%5Bwhatwg%5D%20WebSocket%20handshake%3A%200x0D%20in%20first%20%22line%22&In-Reply-To=%3Cop.vcbxqq16idj3kv%40simon-pieterss-macbook.local%3E"
  18. TITLE="[whatwg] WebSocket handshake: 0x0D in first &quot;line&quot;">simonp at opera.com
  19. </A><BR>
  20. <I>Fri May 7 02:53:04 PDT 2010</I>
  21. <P><UL>
  22. <LI>Previous message: <A HREF="026400.html">[whatwg] WebSocket: garbage collection
  23. </A></li>
  24. <LI>Next message: <A HREF="026221.html">[whatwg] RFC: &lt;input type=&quot;username&quot;&gt;
  25. </A></li>
  26. <LI> <B>Messages sorted by:</B>
  27. <a href="date.html#26220">[ date ]</a>
  28. <a href="thread.html#26220">[ thread ]</a>
  29. <a href="subject.html#26220">[ subject ]</a>
  30. <a href="author.html#26220">[ author ]</a>
  31. </LI>
  32. </UL>
  33. <HR>
  34. <!--/htdig_noindex-->
  35. <!--beginarticle-->
  36. <PRE>establish a WebSocket connection
  37. [[
  38. 28. Read bytes from the server until either the connection closes, or a
  39. 0x0A byte is read. Let field be these bytes, including the 0x0A byte.
  40. If field is not at least seven bytes long, or if the last two bytes aren't
  41. 0x0D and 0x0A respectively, or if it does not contain at least two 0x20
  42. bytes, then fail the WebSocket connection and abort these steps.
  43. User agents may apply a timeout to this step, failing the WebSocket
  44. connection if the server does not send back data in a suitable time period.
  45. 29. Let code be the substring of field that starts from the byte after the
  46. first 0x20 byte, and ends with the byte before the second 0x20 byte.
  47. ]]
  48. This makes it possible for servers to include 0x0D bytes before and after
  49. the status code, and potentially trick broken clients that aren't so fuzzy
  50. with new lines to misinterpret the handshake. Maybe we should read ahead
  51. to the first 0x0D byte and check if the next byte is 0x0A instead.
  52. --
  53. Simon Pieters
  54. Opera Software
  55. </PRE>
  56. <!--endarticle-->
  57. <!--htdig_noindex-->
  58. <HR>
  59. <P><UL>
  60. <!--threads-->
  61. <LI>Previous message: <A HREF="026400.html">[whatwg] WebSocket: garbage collection
  62. </A></li>
  63. <LI>Next message: <A HREF="026221.html">[whatwg] RFC: &lt;input type=&quot;username&quot;&gt;
  64. </A></li>
  65. <LI> <B>Messages sorted by:</B>
  66. <a href="date.html#26220">[ date ]</a>
  67. <a href="thread.html#26220">[ thread ]</a>
  68. <a href="subject.html#26220">[ subject ]</a>
  69. <a href="author.html#26220">[ author ]</a>
  70. </LI>
  71. </UL>
  72. <hr>
  73. <a href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">More information about the whatwg
  74. mailing list</a><br>
  75. <!--/htdig_noindex-->
  76. </body></html>