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

https://github.com/whatwg/whatwg.org · HTML · 90 lines · 74 code · 9 blank · 7 comment · 0 complexity · 89d7b404373a7f74f914b6e40855c5ff MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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. <style type="text/css">
  10. pre {
  11. white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
  12. }
  13. </style>
  14. <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
  15. <LINK REL="Previous" HREF="068673.html">
  16. <LINK REL="Next" HREF="068496.html">
  17. </HEAD>
  18. <BODY BGCOLOR="#ffffff">
  19. <H1>[whatwg] WebSocket handshake: 0x0D in first &quot;line&quot;</H1>
  20. <!--htdig_noindex-->
  21. <B>Simon Pieters</B>
  22. <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"
  23. TITLE="[whatwg] WebSocket handshake: 0x0D in first &quot;line&quot;">simonp at opera.com
  24. </A><BR>
  25. <I>Fri May 7 02:53:04 PDT 2010</I>
  26. <P><UL>
  27. <LI>Previous message: <A HREF="068673.html">[whatwg] WebSocket: garbage collection
  28. </A></li>
  29. <LI>Next message: <A HREF="068496.html">[whatwg] WebSocket set-cookie
  30. </A></li>
  31. <LI> <B>Messages sorted by:</B>
  32. <a href="date.html#68493">[ date ]</a>
  33. <a href="thread.html#68493">[ thread ]</a>
  34. <a href="subject.html#68493">[ subject ]</a>
  35. <a href="author.html#68493">[ author ]</a>
  36. </LI>
  37. </UL>
  38. <HR>
  39. <!--/htdig_noindex-->
  40. <!--beginarticle-->
  41. <PRE>establish a WebSocket connection
  42. [[
  43. 28. Read bytes from the server until either the connection closes, or a
  44. 0x0A byte is read. Let field be these bytes, including the 0x0A byte.
  45. If field is not at least seven bytes long, or if the last two bytes aren't
  46. 0x0D and 0x0A respectively, or if it does not contain at least two 0x20
  47. bytes, then fail the WebSocket connection and abort these steps.
  48. User agents may apply a timeout to this step, failing the WebSocket
  49. connection if the server does not send back data in a suitable time period.
  50. 29. Let code be the substring of field that starts from the byte after the
  51. first 0x20 byte, and ends with the byte before the second 0x20 byte.
  52. ]]
  53. This makes it possible for servers to include 0x0D bytes before and after
  54. the status code, and potentially trick broken clients that aren't so fuzzy
  55. with new lines to misinterpret the handshake. Maybe we should read ahead
  56. to the first 0x0D byte and check if the next byte is 0x0A instead.
  57. --
  58. Simon Pieters
  59. Opera Software
  60. </PRE>
  61. <!--endarticle-->
  62. <!--htdig_noindex-->
  63. <HR>
  64. <P><UL>
  65. <!--threads-->
  66. <LI>Previous message: <A HREF="068673.html">[whatwg] WebSocket: garbage collection
  67. </A></li>
  68. <LI>Next message: <A HREF="068496.html">[whatwg] WebSocket set-cookie
  69. </A></li>
  70. <LI> <B>Messages sorted by:</B>
  71. <a href="date.html#68493">[ date ]</a>
  72. <a href="thread.html#68493">[ thread ]</a>
  73. <a href="subject.html#68493">[ subject ]</a>
  74. <a href="author.html#68493">[ author ]</a>
  75. </LI>
  76. </UL>
  77. <hr>
  78. <a href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">More information about the whatwg
  79. mailing list</a><br>
  80. <!--/htdig_noindex-->
  81. </body></html>