mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Added SVN revision to server version in HTTP header
SVN revision: 1605
This commit is contained in:
parent
5bcba1940e
commit
3fd6385906
24
src/elogd.c
24
src/elogd.c
@ -6201,7 +6201,7 @@ void redirect(LOGBOOK * lbs, char *rel_path)
|
|||||||
{
|
{
|
||||||
/* redirect */
|
/* redirect */
|
||||||
rsprintf("HTTP/1.1 302 Found\r\n");
|
rsprintf("HTTP/1.1 302 Found\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
rsprintf("Connection: Keep-Alive\r\n");
|
rsprintf("Connection: Keep-Alive\r\n");
|
||||||
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
||||||
@ -6406,7 +6406,7 @@ void show_http_header(LOGBOOK * lbs, BOOL expires, char *cookie)
|
|||||||
char str[256];
|
char str[256];
|
||||||
|
|
||||||
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
|
|
||||||
if (getcfg("global", "charset", str, sizeof(str)))
|
if (getcfg("global", "charset", str, sizeof(str)))
|
||||||
rsprintf("Content-Type: text/html;charset=%s\r\n", str);
|
rsprintf("Content-Type: text/html;charset=%s\r\n", str);
|
||||||
@ -6446,7 +6446,7 @@ void show_plain_header(int size, char *file_name)
|
|||||||
{
|
{
|
||||||
/* header */
|
/* header */
|
||||||
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
rsprintf("Accept-Ranges: bytes\r\n");
|
rsprintf("Accept-Ranges: bytes\r\n");
|
||||||
|
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
@ -7087,7 +7087,7 @@ void set_login_cookies(LOGBOOK * lbs, char *user, char *enc_pwd)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
rsprintf("HTTP/1.1 302 Found\r\n");
|
rsprintf("HTTP/1.1 302 Found\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
rsprintf("Connection: Keep-Alive\r\n");
|
rsprintf("Connection: Keep-Alive\r\n");
|
||||||
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
||||||
@ -7139,7 +7139,7 @@ void remove_all_login_cookies(LOGBOOK * lbs)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
rsprintf("HTTP/1.1 302 Found\r\n");
|
rsprintf("HTTP/1.1 302 Found\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
rsprintf("Connection: Keep-Alive\r\n");
|
rsprintf("Connection: Keep-Alive\r\n");
|
||||||
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
||||||
@ -7187,7 +7187,7 @@ void send_file_direct(char *file_name)
|
|||||||
lseek(fh, 0, SEEK_SET);
|
lseek(fh, 0, SEEK_SET);
|
||||||
|
|
||||||
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
rsprintf("Accept-Ranges: bytes\r\n");
|
rsprintf("Accept-Ranges: bytes\r\n");
|
||||||
|
|
||||||
/* set expiration time to one day */
|
/* set expiration time to one day */
|
||||||
@ -12225,7 +12225,7 @@ int show_md5_page(LOGBOOK * lbs)
|
|||||||
|
|
||||||
/* header */
|
/* header */
|
||||||
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
rsprintf("Accept-Ranges: bytes\r\n");
|
rsprintf("Accept-Ranges: bytes\r\n");
|
||||||
rsprintf("Connection: close\r\n");
|
rsprintf("Connection: close\r\n");
|
||||||
rsprintf("Content-Type: text/plain;charset=%s\r\n", DEFAULT_HTTP_CHARSET);
|
rsprintf("Content-Type: text/plain;charset=%s\r\n", DEFAULT_HTTP_CHARSET);
|
||||||
@ -15805,7 +15805,7 @@ void show_rss_feed(LOGBOOK * lbs)
|
|||||||
struct tm *ts;
|
struct tm *ts;
|
||||||
|
|
||||||
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
|
|
||||||
if (!getcfg("global", "charset", charset, sizeof(charset)))
|
if (!getcfg("global", "charset", charset, sizeof(charset)))
|
||||||
strcpy(charset, DEFAULT_HTTP_CHARSET);
|
strcpy(charset, DEFAULT_HTTP_CHARSET);
|
||||||
@ -21821,7 +21821,7 @@ void interprete(char *lbook, char *path)
|
|||||||
if (!check_password(lbs, "Write password", enc_pwd, isparam("redir") ? getparam("redir") : ""))
|
if (!check_password(lbs, "Write password", enc_pwd, isparam("redir") ? getparam("redir") : ""))
|
||||||
return;
|
return;
|
||||||
rsprintf("HTTP/1.1 302 Found\r\n");
|
rsprintf("HTTP/1.1 302 Found\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
rsprintf("Connection: Keep-Alive\r\n");
|
rsprintf("Connection: Keep-Alive\r\n");
|
||||||
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
||||||
@ -21845,7 +21845,7 @@ void interprete(char *lbook, char *path)
|
|||||||
if (!check_password(lbs, "Admin password", enc_pwd, isparam("redir") ? getparam("redir") : ""))
|
if (!check_password(lbs, "Admin password", enc_pwd, isparam("redir") ? getparam("redir") : ""))
|
||||||
return;
|
return;
|
||||||
rsprintf("HTTP/1.1 302 Found\r\n");
|
rsprintf("HTTP/1.1 302 Found\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
if (use_keepalive) {
|
if (use_keepalive) {
|
||||||
rsprintf("Connection: Keep-Alive\r\n");
|
rsprintf("Connection: Keep-Alive\r\n");
|
||||||
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
rsprintf("Keep-Alive: timeout=60, max=10\r\n");
|
||||||
@ -23325,7 +23325,7 @@ void server_loop(void)
|
|||||||
} else if (strstr(net_buffer, "HEAD") != NULL) {
|
} else if (strstr(net_buffer, "HEAD") != NULL) {
|
||||||
/* just return header */
|
/* just return header */
|
||||||
rsprintf("HTTP/1.1 200 OK\r\n");
|
rsprintf("HTTP/1.1 200 OK\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
rsprintf("Connection: close\r\n");
|
rsprintf("Connection: close\r\n");
|
||||||
rsprintf("Content-Type: text/html\r\n\r\n");
|
rsprintf("Content-Type: text/html\r\n\r\n");
|
||||||
keep_alive = FALSE;
|
keep_alive = FALSE;
|
||||||
@ -23764,7 +23764,7 @@ void server_loop(void)
|
|||||||
if (!authorized) {
|
if (!authorized) {
|
||||||
/* return request for authorization */
|
/* return request for authorization */
|
||||||
rsprintf("HTTP/1.1 401 Authorization Required\r\n");
|
rsprintf("HTTP/1.1 401 Authorization Required\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s-%d\r\n", VERSION, atoi(svn_revision+13));
|
||||||
rsprintf("WWW-Authenticate: Basic realm=\"%s\"\r\n", logbook);
|
rsprintf("WWW-Authenticate: Basic realm=\"%s\"\r\n", logbook);
|
||||||
rsprintf("Connection: close\r\n");
|
rsprintf("Connection: close\r\n");
|
||||||
rsprintf("Content-Type: text/html\r\n\r\n");
|
rsprintf("Content-Type: text/html\r\n\r\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user