Fossil SCM
Repeated clicks on the audio-captcha button cause it to start over. Change the title of 206 HTTP replies to "Partial Content".
Commit
8466a1572259134179d933975c850008e0d8c6f5dfac2b007930b7f3b076474b
Parent
29c3e99d7388c84…
2 files changed
+5
-3
+1
+5
-3
| --- src/captcha.c | ||
| +++ src/captcha.c | ||
| @@ -560,13 +560,15 @@ | ||
| 560 | 560 | */ |
| 561 | 561 | void captcha_speakit_button(unsigned int uSeed, const char *zMsg){ |
| 562 | 562 | if( zMsg==0 ) zMsg = "Speak the text"; |
| 563 | 563 | @ <input type="button" value="%h(zMsg)" id="speakthetext"> |
| 564 | 564 | @ <script nonce="%h(style_nonce())"> |
| 565 | - @ var x = document.getElementById("speakthetext") | |
| 566 | - @ x.onclick = function(){ | |
| 567 | - @ var audio = new Audio("%R/captcha-audio/%u(uSeed)") | |
| 565 | + @ document.getElementById("speakthetext").onclick = function(){ | |
| 566 | + @ var audio = window.fossilAudioCaptcha \ | |
| 567 | + @ || new Audio("%R/captcha-audio/%u(uSeed)"); | |
| 568 | + @ window.fossilAudioCaptcha = audio; | |
| 569 | + @ audio.currentTime = 0; | |
| 568 | 570 | @ audio.play(); |
| 569 | 571 | @ } |
| 570 | 572 | @ </script> |
| 571 | 573 | } |
| 572 | 574 | |
| 573 | 575 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -560,13 +560,15 @@ | |
| 560 | */ |
| 561 | void captcha_speakit_button(unsigned int uSeed, const char *zMsg){ |
| 562 | if( zMsg==0 ) zMsg = "Speak the text"; |
| 563 | @ <input type="button" value="%h(zMsg)" id="speakthetext"> |
| 564 | @ <script nonce="%h(style_nonce())"> |
| 565 | @ var x = document.getElementById("speakthetext") |
| 566 | @ x.onclick = function(){ |
| 567 | @ var audio = new Audio("%R/captcha-audio/%u(uSeed)") |
| 568 | @ audio.play(); |
| 569 | @ } |
| 570 | @ </script> |
| 571 | } |
| 572 | |
| 573 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -560,13 +560,15 @@ | |
| 560 | */ |
| 561 | void captcha_speakit_button(unsigned int uSeed, const char *zMsg){ |
| 562 | if( zMsg==0 ) zMsg = "Speak the text"; |
| 563 | @ <input type="button" value="%h(zMsg)" id="speakthetext"> |
| 564 | @ <script nonce="%h(style_nonce())"> |
| 565 | @ document.getElementById("speakthetext").onclick = function(){ |
| 566 | @ var audio = window.fossilAudioCaptcha \ |
| 567 | @ || new Audio("%R/captcha-audio/%u(uSeed)"); |
| 568 | @ window.fossilAudioCaptcha = audio; |
| 569 | @ audio.currentTime = 0; |
| 570 | @ audio.play(); |
| 571 | @ } |
| 572 | @ </script> |
| 573 | } |
| 574 | |
| 575 |
+1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -279,10 +279,11 @@ | ||
| 279 | 279 | if( rangeEnd>0 |
| 280 | 280 | && iReplyStatus==200 |
| 281 | 281 | && fossil_strcmp(P("REQUEST_METHOD"),"GET")==0 |
| 282 | 282 | ){ |
| 283 | 283 | iReplyStatus = 206; |
| 284 | + zReplyStatus = "Partial Content"; | |
| 284 | 285 | } |
| 285 | 286 | fprintf(g.httpOut, "HTTP/1.0 %d %s\r\n", iReplyStatus, zReplyStatus); |
| 286 | 287 | fprintf(g.httpOut, "Date: %s\r\n", cgi_rfc822_datestamp(time(0))); |
| 287 | 288 | fprintf(g.httpOut, "Connection: close\r\n"); |
| 288 | 289 | fprintf(g.httpOut, "X-UA-Compatible: IE=edge\r\n"); |
| 289 | 290 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -279,10 +279,11 @@ | |
| 279 | if( rangeEnd>0 |
| 280 | && iReplyStatus==200 |
| 281 | && fossil_strcmp(P("REQUEST_METHOD"),"GET")==0 |
| 282 | ){ |
| 283 | iReplyStatus = 206; |
| 284 | } |
| 285 | fprintf(g.httpOut, "HTTP/1.0 %d %s\r\n", iReplyStatus, zReplyStatus); |
| 286 | fprintf(g.httpOut, "Date: %s\r\n", cgi_rfc822_datestamp(time(0))); |
| 287 | fprintf(g.httpOut, "Connection: close\r\n"); |
| 288 | fprintf(g.httpOut, "X-UA-Compatible: IE=edge\r\n"); |
| 289 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -279,10 +279,11 @@ | |
| 279 | if( rangeEnd>0 |
| 280 | && iReplyStatus==200 |
| 281 | && fossil_strcmp(P("REQUEST_METHOD"),"GET")==0 |
| 282 | ){ |
| 283 | iReplyStatus = 206; |
| 284 | zReplyStatus = "Partial Content"; |
| 285 | } |
| 286 | fprintf(g.httpOut, "HTTP/1.0 %d %s\r\n", iReplyStatus, zReplyStatus); |
| 287 | fprintf(g.httpOut, "Date: %s\r\n", cgi_rfc822_datestamp(time(0))); |
| 288 | fprintf(g.httpOut, "Connection: close\r\n"); |
| 289 | fprintf(g.httpOut, "X-UA-Compatible: IE=edge\r\n"); |
| 290 |