Changeset 32964 in project


Ignore:
Timestamp:
12/07/15 23:00:50 (5 years ago)
Author:
sjamaan
Message:

intarweb: Detect when someone used the old API for parse-params and error out to avoid hidden breakage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/intarweb/trunk/header-parsers.scm

    r32963 r32964  
    180180        (values #f start-pos))))
    181181
    182 (define (parse-params string start-pos param-subparsers #!optional (stop-set (char-set #\;)) (seperator-or-stop-set (char-set #\; #\=)))
     182(define (parse-params string start-pos param-subparsers #!optional (stop-set (char-set #\;)) (separator-or-stop-set (char-set #\; #\=)))
    183183  (let loop ((start-pos start-pos)
    184184             (params '()))
     185    (unless separator-or-stop-set
     186      (error "The parse-params API has changed a bit for performance reasons: if you pass the optional stop char set, you need to pass one more argument which is the same char-set extended with an equals-sign"))
    185187    (receive (attribute-name pos)
    186         (parse-token string start-pos seperator-or-stop-set)
     188        (parse-token string start-pos separator-or-stop-set)
    187189      (if attribute-name
    188190          (let ((attribute (http-name->symbol attribute-name)))
Note: See TracChangeset for help on using the changeset viewer.