feat: add Server header
parent
d725a090a2
commit
8f9de37a95
4
Makefile
4
Makefile
|
@ -1,6 +1,8 @@
|
||||||
# https://spin.atomicobject.com/2016/08/26/makefile-c-projects/ was a great
|
# https://spin.atomicobject.com/2016/08/26/makefile-c-projects/ was a great
|
||||||
# base for this Makefile
|
# base for this Makefile
|
||||||
|
|
||||||
|
VERSION := 0.1.0
|
||||||
|
|
||||||
BIN_FILENAME ?= lander
|
BIN_FILENAME ?= lander
|
||||||
|
|
||||||
BUILD_DIR ?= build
|
BUILD_DIR ?= build
|
||||||
|
@ -34,7 +36,7 @@ INC_FLAGS := $(addprefix -I,$(INC_DIRS))
|
||||||
# -MP: generate a dummy target for every header file (according to the docs it
|
# -MP: generate a dummy target for every header file (according to the docs it
|
||||||
# prevents some errors when removing header files)
|
# prevents some errors when removing header files)
|
||||||
CFLAGS ?= -MMD -MP -g
|
CFLAGS ?= -MMD -MP -g
|
||||||
INTERNALCFLAGS := $(INC_FLAGS) $(CFLAGS) -Wall -Wextra
|
INTERNALCFLAGS := $(INC_FLAGS) $(CFLAGS) -Wall -Wextra -DLANDER_VERSION=\"$(VERSION)\"
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: bin
|
all: bin
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||||
|
|
||||||
static const char *http_response_format = "HTTP/1.1 %i %s\n"
|
static const char *http_response_format = "HTTP/1.1 %i %s\n"
|
||||||
|
"Server: lander/" LANDER_VERSION "\n"
|
||||||
"Content-Length: %lu\n\n";
|
"Content-Length: %lu\n\n";
|
||||||
|
|
||||||
void http_loop_init_header(http_response *res) {
|
void http_loop_init_header(http_response *res) {
|
||||||
|
|
Loading…
Reference in New Issue