Fossil SCM
A valid /chat-ping request should set the Access-Control-Allow-Origin in the reply header, to avoid client-side errors.
Commit
ffb40fd8940c59a72fd68a0737f32d0c621307422d85b99fc9466a686256f17b
Parent
35fbf4995d7064e…
1 file changed
+4
-1
+4
-1
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -587,11 +587,14 @@ | ||
| 587 | 587 | ** a single \007 (bel) character to be written on the controlling TTY. |
| 588 | 588 | ** This is used to implement an audiable alert by local web clients. |
| 589 | 589 | */ |
| 590 | 590 | void chat_ping_webpage(void){ |
| 591 | 591 | const char *zIpAddr = PD("REMOTE_ADDR","nil"); |
| 592 | - if( cgi_is_loopback(zIpAddr) ) fputc(7, stderr); | |
| 592 | + if( cgi_is_loopback(zIpAddr) ){ | |
| 593 | + cgi_append_header("Access-Control-Allow-Origin: *\r\n"); | |
| 594 | + fputc(7, stderr); | |
| 595 | + } | |
| 593 | 596 | } |
| 594 | 597 | |
| 595 | 598 | /* |
| 596 | 599 | ** COMMAND: chat |
| 597 | 600 | ** |
| 598 | 601 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -587,11 +587,14 @@ | |
| 587 | ** a single \007 (bel) character to be written on the controlling TTY. |
| 588 | ** This is used to implement an audiable alert by local web clients. |
| 589 | */ |
| 590 | void chat_ping_webpage(void){ |
| 591 | const char *zIpAddr = PD("REMOTE_ADDR","nil"); |
| 592 | if( cgi_is_loopback(zIpAddr) ) fputc(7, stderr); |
| 593 | } |
| 594 | |
| 595 | /* |
| 596 | ** COMMAND: chat |
| 597 | ** |
| 598 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -587,11 +587,14 @@ | |
| 587 | ** a single \007 (bel) character to be written on the controlling TTY. |
| 588 | ** This is used to implement an audiable alert by local web clients. |
| 589 | */ |
| 590 | void chat_ping_webpage(void){ |
| 591 | const char *zIpAddr = PD("REMOTE_ADDR","nil"); |
| 592 | if( cgi_is_loopback(zIpAddr) ){ |
| 593 | cgi_append_header("Access-Control-Allow-Origin: *\r\n"); |
| 594 | fputc(7, stderr); |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | /* |
| 599 | ** COMMAND: chat |
| 600 | ** |
| 601 |