summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorUwe Schindler <thetaphi@php.net>2003-10-31 17:31:46 +0000
committerUwe Schindler <thetaphi@php.net>2003-10-31 17:31:46 +0000
commitd3d94ff2f32b2e43ba782621ee872541082024db (patch)
tree74e561c3730661842174e94351a76873beb5d47c /sapi
parent25e1f920d14dd07ae26866d9479b19cfd10182c5 (diff)
downloadphp-git-d3d94ff2f32b2e43ba782621ee872541082024db.tar.gz
fix header handler
Diffstat (limited to 'sapi')
-rw-r--r--sapi/nsapi/nsapi.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 3524b8b57e..cb9b62a96b 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -486,12 +486,15 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade
param_free(pblock_remove("content-type", rc->rq->srvhdrs));
pblock_nvinsert("content-type", header_content, rc->rq->srvhdrs);
} else {
+ /* to lower case because NSAPI reformats the headers and wants lowercase */
+ for (p=header_name; *p; p++) {
+ *p=tolower(*p);
+ }
+ if (sapi_header->replace) param_free(pblock_remove(header_name, rc->rq->srvhdrs));
pblock_nvinsert(header_name, header_content, rc->rq->srvhdrs);
}
- *p = ':'; /* restore '*p' */
-
- efree(sapi_header->header);
+ sapi_free_header(sapi_header);
return 0; /* don't use the default SAPI mechanism, NSAPI duplicates this functionality */
}
@@ -501,10 +504,6 @@ static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
int retval;
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
- /*
- * We could probably just do this in the header_handler. But, I
- * don't know what the implication of doing it there is.
- */
if (SG(sapi_headers).send_default_content_type) {
char *hd;
param_free(pblock_remove("content-type", rc->rq->srvhdrs));