emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#10109: closed ([PATCH] (web http): list-style head


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#10109: closed ([PATCH] (web http): list-style headers do not validate)
Date: Wed, 23 Nov 2011 22:58:02 +0000

Your message dated Wed, 23 Nov 2011 21:25:48 +0100
with message-id <address@hidden>
and subject line Re: bug#10109: [PATCH] (web http): list-style headers do not 
validate
has caused the debbugs.gnu.org bug report #10109,
regarding [PATCH] (web http): list-style headers do not validate
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
10109: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10109
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] (web http): list-style headers do not validate Date: Wed, 23 Nov 2011 02:18:36 +0800
Package: guile
Version: 2.0.3
Tags: patch

Many of the list-style headers from (web http) do not validate
correctly.  The test suite only checks that the header's parse and
does not test the associated validators.

Attached is a very quick patch (0002) which exposes the failing
validators through the test-suite:

$ ./guile-test tests/web-http.test
Running tests/web-http.test
...
FAIL: tests/web-http.test: general headers: cache-control:
"no-transform" -> (no-transform)
FAIL: tests/web-http.test: general headers: cache-control:
"no-transform,foo" -> (no-transform foo)
FAIL: tests/web-http.test: general headers: cache-control: "no-cache"
-> (no-cache)
FAIL: tests/web-http.test: general headers: cache-control:
"no-cache=\"Authorization, Date\"" -> ((no-cache authorization date))
FAIL: tests/web-http.test: general headers: cache-control:
"private=\"Foo\"" -> ((private foo))
FAIL: tests/web-http.test: general headers: cache-control:
"no-cache,max-age=10" -> (no-cache (max-age . 10))
FAIL: tests/web-http.test: general headers: pragma: "no-cache" -> (no-cache)
FAIL: tests/web-http.test: general headers: pragma: "no-cache, foo" ->
(no-cache foo)
FAIL: tests/web-http.test: general headers: transfer-encoding: "foo,
chunked" -> ((foo) (chunked))
FAIL: tests/web-http.test: entity headers: allow: "foo, bar" -> (foo bar)
FAIL: tests/web-http.test: entity headers: content-encoding: "qux,
baz" -> (qux baz)
FAIL: tests/web-http.test: request headers: accept: "text/*;q=0.3,
text/html;q=0.7, text/html;level=1" -> ((text/* (q . 300)) (text/html
(q . 700)) (text/html (level . "1")))
FAIL: tests/web-http.test: request headers: authorization: "Basic
foooo" -> (basic . "foooo")
FAIL: tests/web-http.test: request headers: authorization: "Digest
foooo" -> (digest foooo)
FAIL: tests/web-http.test: request headers: expect: "100-continue,
foo" -> ((#{100-continue}#) (foo))
FAIL: tests/web-http.test: request headers: proxy-authorization:
"Basic foooo" -> (basic . "foooo")
FAIL: tests/web-http.test: request headers: proxy-authorization:
"Digest foooo" -> (digest foooo)
FAIL: tests/web-http.test: request headers: te: "trailers" -> ((trailers))
FAIL: tests/web-http.test: request headers: te: "trailers,foo" ->
((trailers) (foo))
FAIL: tests/web-http.test: response headers: accept-ranges: "foo,bar"
-> (foo bar)

Totals for this test run:
passes:                 60
failures:               20
...


The other patch (0001) corrects `http.scm' for some typos and missing logic,
after which the above failures no longer occur.

$ ./guile-test tests/web-http.test
Running tests/web-http.test
...

Totals for this test run:
passes:                 80
failures:               0
...


0001 (web http): fix validators for various list-style headers

* module/web/http.scm (default-val-validator): Valid with no value.
  (key-value-list?): Keys are always symbols, do not accept strings.
  (validate-param-list): Apply `valid?' to list elements.
  (validate-credentials): Validate param for Basic scheme, which
  is parsed as a string.
  (declare-symbol-list-header!): `list-of?' args were in wrong order.
  ("Cache-Control"): Replace `default-val-validator' with more
  specific procedure.
  ("Accept"): Validate on first param which has no value.
---
 module/web/http.scm |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

Attachment: 0001-web-http-fix-validators-for-various-list-style-heade.patch
Description: Text Data

Attachment: 0002-web-http-test.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#10109: [PATCH] (web http): list-style headers do not validate Date: Wed, 23 Nov 2011 21:25:48 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
On Tue 22 Nov 2011 19:18, Daniel Hartwig <address@hidden> writes:

> Many of the list-style headers from (web http) do not validate
> correctly.  The test suite only checks that the header's parse and
> does not test the associated validators.

I applied both of your patches.  Thank you very much!

In the future, please make your patches as separate git commits in your
repository.  Then do `git format-patch origin/stable-2.0..HEAD'.  Then
attach the generated files to a mail.  The advantage is that I don't
have to cut and paste your commit log, and I don't have to make special
effort to ensure that you are listed as the author in the commits.

Also, your first patch is probably at the limit of how big a patch we
can accept without getting you to assign copyright to the FSF.  If you
think you will send more patches in the future, it's probably a good
idea to start that process, if you are OK with that.  Email me privately
and I'll tell you how to do that.  Note that GNU has recently entered
the 20th century ;) by sending the forms via PDF.  You can submit them
electronically too, but only if you are a US resident.  Anyway, send me
an email if you are interested.

Thanks again for the patches!

Andy
-- 
http://wingolog.org/


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]