feat(lander): re-add Server header
This commit is contained in:
parent
cda61f5433
commit
4ae1355cec
4 changed files with 16 additions and 0 deletions
|
|
@ -131,3 +131,8 @@ void lnm_http_loop_set_api_key(lnm_http_loop *hl, const char *api_key) {
|
|||
lnm_http_loop_gctx *gctx = hl->gctx;
|
||||
gctx->api_key = api_key;
|
||||
}
|
||||
|
||||
void lnm_http_loop_set_server(lnm_http_loop *hl, const char *server) {
|
||||
lnm_http_loop_gctx *gctx = hl->gctx;
|
||||
gctx->server = server;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,6 +158,11 @@ void lnm_http_loop_state_process_add_headers(lnm_http_conn *conn) {
|
|||
lnm_http_res_add_header_len(res, lnm_http_header_content_length, buf, digits,
|
||||
true);
|
||||
|
||||
if (ctx->g->server != NULL) {
|
||||
lnm_http_res_add_header(res, lnm_http_header_server, (char *)ctx->g->server,
|
||||
false);
|
||||
}
|
||||
|
||||
ctx->state = lnm_http_loop_state_write_status_line;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue