YAZ_EXPORT void z_HTTP_header_add_basic_auth(ODR o, Z_HTTP_Header **hp,
const char *username,
const char *password);
-
-YAZ_EXPORT const char *z_HTTP_header_lookup(const Z_HTTP_Header *hp, const char *n);
+YAZ_EXPORT const char *z_HTTP_header_lookup(const Z_HTTP_Header *hp,
+ const char *n);
+YAZ_EXPORT const char *z_HTTP_header_remove(Z_HTTP_Header **hp,
+ const char *n);
YAZ_EXPORT const char *z_HTTP_errmsg(int code);
(*hp)->next = 0;
}
+const char *z_HTTP_header_remove(Z_HTTP_Header **hp, const char *n)
+{
+ while (*hp)
+ {
+ if (!yaz_strcasecmp((*hp)->name, n))
+ {
+ const char *v = (*hp)->value;
+ *hp = (*hp)->next;
+ return v;
+ }
+ hp = &(*hp)->next;
+ }
+ return 0;
+}
+
const char *z_HTTP_header_lookup(const Z_HTTP_Header *hp, const char *n)
{
for (; hp; hp = hp->next)