From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Support Websocket status code Date: Wed, 07 Aug 2019 02:52:37 -0400 Message-ID: <87d0hhh3fz.fsf@netris.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="112949"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: guile-devel To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Aug 07 08:53:00 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hvFoi-000TEU-1m for guile-devel@m.gmane.org; Wed, 07 Aug 2019 08:53:00 +0200 Original-Received: from localhost ([::1]:37512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvFog-00011V-On for guile-devel@m.gmane.org; Wed, 07 Aug 2019 02:52:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56877) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvFod-00011D-Dd for guile-devel@gnu.org; Wed, 07 Aug 2019 02:52:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvFob-0004uD-PY for guile-devel@gnu.org; Wed, 07 Aug 2019 02:52:55 -0400 Original-Received: from world.peace.net ([64.112.178.59]:34716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hvFob-0004tr-MA for guile-devel@gnu.org; Wed, 07 Aug 2019 02:52:53 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hvFoa-0006cS-LP; Wed, 07 Aug 2019 02:52:52 -0400 In-Reply-To: (Nala Ginrut's message of "Fri, 26 Jul 2019 14:06:48 +0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.112.178.59 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20034 Archived-At: Hi, Nala Ginrut writes: > Hi folks! > The current response builder will reject status code less than 600: > -------------------------------code------------------------- > ((not (and (non-negative-integer? code) (< code 600))) > (bad-response "Bad code: ~a" code)) > --------------------------------------------------------------- > > However, Websocket specific status code is larger than 1000. Section 4.2.2 paragraph 5 of RFC 6455 (the WebSocket RFC) makes it clear that the HTTP response should conform to RFC 2616, which specifies that the status code is a 3-digit integer less than 600. If I understand correctly, the larger status codes defined in section 7.4.1 of RFC 6455 are never used in HTTP response headers. Rather, they are optionally used in WebSocket Close control frames to indicate the reason for closure. See section 7.1.6 for more on that. The WebSocket protocol is quite distinct from the HTTP protocol. Although HTTP is used initially, after the server returns the HTTP response with status "101 Switching Protocols", a completely different protocol is used henceforth. So, I don't see anything in the RFCs to justify using the larger status codes in HTTP response status line. Am I misunderstanding something? Mark