summaryrefslogtreecommitdiff
path: root/src/journal/journal-gatewayd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-11 02:37:10 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-11 02:37:10 +0200
commit48383c251185c4596e9098878b28334c69e7bfd9 (patch)
tree008dbe8d4d7f87520b839e0f63e34d7190daca2d /src/journal/journal-gatewayd.c
parent33316dbf20d378e15d126d97d0415407853a7fb8 (diff)
journal: support epxorting the journal in a format suitable for text/event-stream
Diffstat (limited to 'src/journal/journal-gatewayd.c')
-rw-r--r--src/journal/journal-gatewayd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c
index 33dda266b6..b2d4abf4fe 100644
--- a/src/journal/journal-gatewayd.c
+++ b/src/journal/journal-gatewayd.c
@@ -55,7 +55,8 @@ typedef struct RequestMeta {
static const char* const mime_types[_OUTPUT_MODE_MAX] = {
[OUTPUT_SHORT] = "text/plain",
[OUTPUT_JSON] = "application/json",
- [OUTPUT_EXPORT] = "application/vnd.fdo.journal"
+ [OUTPUT_JSON_SSE] = "text/event-stream",
+ [OUTPUT_EXPORT] = "application/vnd.fdo.journal",
};
static RequestMeta *request_meta(void **connection_cls) {
@@ -286,6 +287,8 @@ static int request_parse_accept(
if (streq(accept, mime_types[OUTPUT_JSON]))
m->mode = OUTPUT_JSON;
+ else if (streq(accept, mime_types[OUTPUT_JSON_SSE]))
+ m->mode = OUTPUT_JSON_SSE;
else if (streq(accept, mime_types[OUTPUT_EXPORT]))
m->mode = OUTPUT_EXPORT;
else