aboutsummaryrefslogtreecommitdiff
path: root/testdata/http_server/execute/local_test.data
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-02-06 07:08:29 +0700
committerShulhan <ms@kilabit.info>2026-02-06 07:08:29 +0700
commit54d395f53e344a3cf3861c0e3d2f82ad14ecc602 (patch)
tree9f19525f8b950ddd9d715d9abe71e5545df4d65e /testdata/http_server/execute/local_test.data
parenta3c27356bfe3e56809f579b617e02829a7ea0a68 (diff)
downloadawwan-54d395f53e344a3cf3861c0e3d2f82ad14ecc602.tar.xz
all: improve the Server-Sent Events (SSE) output
In the ExecResponse, store the event in the Output instead of message data, so the server can iterate the Output directly and pass it to WriteEvent directly. The event ID now start at 1 with type "begin". This is to minimize confusion when comparing empty Last-Event-ID from client, which is equal to 0.
Diffstat (limited to 'testdata/http_server/execute/local_test.data')
-rw-r--r--testdata/http_server/execute/local_test.data21
1 files changed, 15 insertions, 6 deletions
diff --git a/testdata/http_server/execute/local_test.data b/testdata/http_server/execute/local_test.data
index 5f96637..0c573b8 100644
--- a/testdata/http_server/execute/local_test.data
+++ b/testdata/http_server/execute/local_test.data
@@ -16,35 +16,44 @@
"begin_at": "2023-11-26T15:21:00Z",
"end_at": "",
"error": "",
- "output": []
+ "output": [
+ {
+ "Type": "begin",
+ "Data": "2023-11-26T15:21:00Z",
+ "ID": "1"
+ }
+ ]
},
"code": 200
}
<<< local:/local.aww:1-:tail
event: open
+data: ""
+id:
event: begin
data: "2023-11-26T15:21:00Z"
+id: 1
event: message
data: " === BEGIN: local /local.aww 1-\n"
-id: 0
+id: 2
event: message
data: " --> 1: echo \"test\"\n"
-id: 1
+id: 3
event: message
data: "test\n"
-id: 2
+id: 4
event: message
data: " === END: local /local.aww 1-\n"
-id: 3
+id: 5
event: end
data: "2023-11-26T15:21:00Z"
-id: 3
+id: 6