The APIs for working with HTTP headers appear to be designed
to support multi-valued (comma-separated) headers. So as I
understand it, I should be able to do things like:
nval = TSMimeHdrFieldValuesCount(...);
for (i=0; i<nval; i++) {
value = TSMimeHdrFieldValueStringGet(...);
/* do something with value */
TSMimeHdrFieldValueStringSet(... newvalue ...)
}
Trying that on a multi-valued header in practice, I find
nval is always 1 and TSMimeHdrFieldValueStringGet returns
the entire string. But by contrast,
TSMimeHdrFieldValueStringSet sets only the first value.
Trivial example: suppose I just want to uppercase my values.
Then in the above loop,
Header: value1, value2, value3
becomes
Header: VALUE1, VALUE2, VALUE3, value2, value3
as the entire string is processed and replaces value1,
leaving value2 and value3 untouched.
Is this a TS bug or a PBKAC?
--
Nick Kew