Skip to content

Commit 6fa2406

Browse files
author
QuickSander
committed
Fix build error
1 parent 47db56e commit 6fa2406

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/internals/StreamHttpReply.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ String ArduinoHttpServer::StreamHttpErrorReply::getHtmlBody(const String& data)
121121

122122
String ArduinoHttpServer::StreamHttpErrorReply::getJsonBody(const String& data)
123123
{
124+
// Copy string since replace modifies original.
125+
String dataCopy(data);
126+
dataCopy.replace("\"", "\\\"");
127+
124128
String body;
125129
body += "{\"Error\": \"";
126-
body += data.replace("\"", "\\\"");
130+
body +=dataCopy;
127131
body += "\"}";
128132

129133
return body;

0 commit comments

Comments
 (0)