Skip to content

Commit 1e11264

Browse files
committed
quality of life fixes
1 parent 7144862 commit 1e11264

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ writeHttpResponse() {
410410
output &
411411
PID=$!
412412

413-
on_open 1>&2
413+
[[ $(type -t on_open) == function ]] && on_open 1>&2
414414

415415
while IFS= read -r line; do
416416
:
@@ -420,7 +420,7 @@ writeHttpResponse() {
420420
wait $PID 2>/dev/null
421421

422422
unsubscribe "$SUB_FD"
423-
on_close 1>&2
423+
[[ $(type -t on_close) == function ]] && on_close 1>&2
424424

425425
return
426426
elif [[ "$directive_test" == "# headers" ]]; then
@@ -534,6 +534,8 @@ export -f subscribe
534534
export -f unsubscribe
535535
export -f publish
536536
export -f event
537+
export -f header
538+
export -f end_headers
537539
export -f htmx_page
538540
export -f findPredefinedRoutes
539541
export -f findDynamicRoutes

0 commit comments

Comments
 (0)