Ignore:
Timestamp:
09/23/08 22:42:42 (13 years ago)
Author:
sjamaan
Message:

Add feeble beginnings of the new spiffy implementation based on intarweb

File:
1 edited

Legend:

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

    r11947 r11983  
    2222(define (header-values header-name headers)
    2323  (map (cut vector-ref <> 0) (header-contents header-name headers '())))
     24
     25;; Get the value of a header, assuming it has only one value
     26(define (header-value header-name headers #!optional (default #f))
     27  (let ((contents (header-contents header-name headers '())))
     28    (if (null? contents)
     29        default
     30        (vector-ref (car contents) 0))))
    2431
    2532;; Get the value of a header which is an alist
Note: See TracChangeset for help on using the changeset viewer.