summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2017-02-04 18:23:51 +0100
committerSebastian Reichel <sre@ring0.de>2017-02-04 18:23:51 +0100
commitdf28710b933a747a10b13e42a2c0bfb703c82f16 (patch)
tree16ad41543ba2ce69429deb5fec27666b763271a1 /src
parentbd025aaaca75253f8c4cfea4cb1353dcfb020e49 (diff)
downloadserial-barcode-scanner-df28710b933a747a10b13e42a2c0bfb703c82f16.tar.bz2
web: set status 200 for succesful requests
Diffstat (limited to 'src')
-rw-r--r--src/web/web.vala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/web/web.vala b/src/web/web.vala
index 474d685..fb03e4b 100644
--- a/src/web/web.vala
+++ b/src/web/web.vala
@@ -23,6 +23,7 @@ public class WebServer {
t.replace("TITLE", "KtT Shop System");
t.menu_set_active("home");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -41,6 +42,7 @@ public class WebServer {
t.replace("TITLE", "KtT Shop System");
t.menu_set_active("home");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -108,6 +110,7 @@ public class WebServer {
t.replace("DATA", data);
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -138,6 +141,7 @@ public class WebServer {
t.replace("STEP1", "block");
t.replace("STEP2", "none");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
return;
} else {
var keylist = pgp.import_archive(filedata.data);
@@ -157,6 +161,7 @@ public class WebServer {
t.replace("STEP1", "none");
t.replace("STEP2", "block");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
return;
}
} catch(TemplateError e) {
@@ -190,6 +195,7 @@ public class WebServer {
t.replace("STEP23", "none");
t.replace("STEP3", "none");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
return;
} else {
if(filedata != null) {
@@ -261,6 +267,7 @@ public class WebServer {
}
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -367,6 +374,7 @@ public class WebServer {
}
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -483,6 +491,7 @@ public class WebServer {
t.replace("SUM", @"$sum €");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -548,6 +557,7 @@ public class WebServer {
t.replace("NEWPRODUCT", "none");
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -579,6 +589,7 @@ public class WebServer {
t.replace("DATA", table);
msg.set_response("text/html", Soup.MemoryUse.COPY, t.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -1169,6 +1180,7 @@ public class WebServer {
template.replace("CASHBOX_HISTORY", hist);
template.menu_set_active("cashbox");
msg.set_response("text/html", Soup.MemoryUse.COPY, template.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -1239,6 +1251,7 @@ public class WebServer {
}
msg.set_response("text/html", Soup.MemoryUse.COPY, template.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -1263,6 +1276,7 @@ public class WebServer {
template.replace("TITLE", "KtT Shop System: Cashbox Detail");
template.menu_set_active("cashbox");
msg.set_response("text/html", Soup.MemoryUse.COPY, template.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);
@@ -1343,6 +1357,7 @@ public class WebServer {
template.replace("WITHDRAWAL_LIST", withdrawal_list);
msg.set_response("text/html", Soup.MemoryUse.COPY, template.data);
+ msg.set_status(200);
} catch(TemplateError e) {
stderr.printf(e.message+"\n");
handler_404(server, msg, path, query, client);