[MINOR] Allow to specify a domain for a cookie
authorKrzysztof Piotr Oledzki <ole@ans.pl>
Fri, 23 May 2008 21:49:32 +0000 (23:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 25 May 2008 08:09:02 +0000 (10:09 +0200)
commitefe3b6f524c5cc6328233941ca44247993342d71
treef5797234697da611af34aa8148c812e114501a60
parent1fb6c87cce82f7f620f30e7b44fa607114fec8d9
[MINOR] Allow to specify a domain for a cookie

This patch allows to specify a domain used when inserting a cookie
providing a session stickiness. Usefull for example with wildcard domains.

The patch adds one new variable to the struct proxy: cookiedomain.
When set the domain is appended to a Set-Cookie header.

Domain name is validated using the new invalid_domainchar() function.
It is basically invalid_char() limited to [A-Za-z0-9_.-]. Yes, the test
is too trivial and does not cover all wrong situations, but the main
purpose is to detect most common mistakes, not intentional abuses.

The underscore ("_") character is not RFC-valid but as it is
often (mis)used so I decided to allow it.
doc/configuration.txt
include/common/standard.h
include/types/proxy.h
src/cfgparse.c
src/proto_http.c
src/standard.c