From 818e434c607a091704d65bca0a6c89c30eac29b0 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 16 Mar 2012 02:54:13 -0400 Subject: [PATCH] Remove no-longer used net/cgi exceptions. --- collects/net/cgi-sig.rkt | 5 ----- collects/net/cgi.rkt | 32 +----------------------------- collects/net/scribblings/cgi.scrbl | 20 ------------------- 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/collects/net/cgi-sig.rkt b/collects/net/cgi-sig.rkt index 6ec6aacadc..43dfa6a616 100644 --- a/collects/net/cgi-sig.rkt +++ b/collects/net/cgi-sig.rkt @@ -1,10 +1,5 @@ #lang racket/signature -;; -- exceptions raised -- -(struct cgi-error ()) -(struct incomplete-%-suffix (chars)) -(struct invalid-%-suffix (char)) - ;; -- cgi methods -- get-bindings get-bindings/post diff --git a/collects/net/cgi.rkt b/collects/net/cgi.rkt index 9612982942..1348217587 100644 --- a/collects/net/cgi.rkt +++ b/collects/net/cgi.rkt @@ -3,10 +3,6 @@ (require "uri-codec.rkt") (provide - ;; -- exceptions raised -- - (struct-out cgi-error) - (struct-out incomplete-%-suffix) - (struct-out invalid-%-suffix) ;; -- cgi methods -- get-bindings @@ -28,32 +24,6 @@ ;; -------------------------------------------------------------------- -;; Exceptions: - -(define-struct cgi-error ()) - -;; chars : list (char) -;; -- gives the suffix which is invalid, not including the `%' - -(define-struct (incomplete-%-suffix cgi-error) (chars)) - -;; char : char -;; -- an invalid character in a hex string - -(define-struct (invalid-%-suffix cgi-error) (char)) - -;; -------------------------------------------------------------------- - -;; query-string->string : string -> string - -;; -- The input is the string post-processed as per Web specs, which -;; is as follows: -;; spaces are turned into "+"es and lots of things are turned into %XX, where -;; XX are hex digits, eg, %E7 for ~. The output is a regular Scheme string -;; with all the characters converted back. - -(define query-string->string form-urlencoded-decode) - ;; string->html : string -> string ;; -- the input is raw text, the output is HTML appropriately quoted @@ -137,7 +107,7 @@ (list (format "Server generated malformed input for ~a method:" method) (apply format fmt xs)))) (define value-rx (delimiter->rx (current-alist-separator-mode))) - (define (process str) (query-string->string (bytes->string/utf-8 str))) + (define (process str) (form-urlencoded-decode (bytes->string/utf-8 str))) (let loop ([bindings '()]) (if (eof-object? (peek-char ip)) (reverse bindings) diff --git a/collects/net/scribblings/cgi.scrbl b/collects/net/scribblings/cgi.scrbl index 169ccef9b0..28ce337b03 100644 --- a/collects/net/scribblings/cgi.scrbl +++ b/collects/net/scribblings/cgi.scrbl @@ -116,26 +116,6 @@ CGI script, unpredictable otherwise.} Converts a set of bindings into a list of HTML strings, which is useful for debugging.} - -@defstruct[cgi-error ()]{ - -A supertype for all exceptions thrown by the @racketmodname[net/cgi] -library.} - - -@defstruct[(incomplete-%-suffix cgi-error) ([chars (listof char?)])]{ - -Raised when a @litchar{%} in a query is followed by an incomplete -suffix. The characters of the suffix---excluding the -@litchar{%}---are provided by the exception.} - - -@defstruct[(invalid-%-suffix cgi-error) ([char char?])]{ - -Raised when the character immediately following a @litchar{%} in a -query is invalid.} - - @; ---------------------------------------- @section{CGI Unit}