Merge pull request #5353 from TD-er/bugfix/JS_error_TXbuff_end_chunked

[Cleanup] Fix JS issues + correctly end chunked transfer
This commit is contained in:
TD-er
2025-07-09 12:37:37 +02:00
committed by GitHub
3 changed files with 4 additions and 6 deletions
+1 -3
View File
@@ -270,7 +270,7 @@ void Web_StreamingBuffer::endStream() {
if (!lowMemorySkip) {
if (buf.length() > 0) { sendContentBlocking(buf); }
buf.clear();
// sendContentBlocking(buf);
sendContentBlocking(buf);
web_server.client().PR_9453_FLUSH_TO_CLEAR();
@@ -293,8 +293,6 @@ void Web_StreamingBuffer::endStream() {
addLog(LOG_LEVEL_ERROR, concat("Webpage skipped: low memory: ", finalRam));
lowMemorySkip = false;
}
const char *footer_empty = "0\r\n\r\n";
web_server.client().write(footer_empty, 5);
delay(5);
web_server.client().stop();
+2 -2
View File
@@ -103,7 +103,7 @@ static const char DATA_GITHUB_CLIPBOARD_JS[] PROGMEM = {
"{var o='copyText_'+n,t=document.getElementById(o);if(t){var a='|';n%2==0&&(a+='\\n'),e+=t.innerHTML.replace(/<[Bb][Rr]\\s*\\/?>/gim,'\\n')+a}else n=101}"
"e=(e=e.replace(/<\\/[Dd][Ii][Vv]\\s*\\/?>/gim,'\\n')).replace(/<[^>]*>/gim,'');"
"var i=document.createElement('textarea');i.style='position: absolute;left: -1000px; top: -1000px',i.innerHTML=e,document.body.appendChild(i),i.select(),document.execCommand('copy'),"
"document.body.removeChild(i),alert('Copied: ''+e+'' to clipboard!')}"
"document.body.removeChild(i),alert('Copied: '+e+' to clipboard!');}"
};
#endif
@@ -356,7 +356,7 @@ static const char jsClipboardCopyPart3[] PROGMEM = {
"ti.select();"
"document.execCommand('copy');"
"document.body.removeChild(ti);"
"alert('Copied: \"' + cb + '\" to clipboard!') }"
"alert('Copied: \"' + cb + '\" to clipboard!'); }"
"</script>"
};
+1 -1
View File
@@ -23,5 +23,5 @@ function setGithubClipboard() {
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
alert('Copied: "' + clipboard + '" to clipboard!')
alert('Copied: "' + clipboard + '" to clipboard!');
}