Skip to content

Commit

Permalink
fix header handler
Browse files Browse the repository at this point in the history
  • Loading branch information
uschindler committed Oct 31, 2003
1 parent 25e1f92 commit d3d94ff
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions sapi/nsapi/nsapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand All @@ -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));
Expand Down

0 comments on commit d3d94ff

Please sign in to comment.