Index: Source/modules/websockets/WebSocketHandshake.cpp |
diff --git a/Source/modules/websockets/WebSocketHandshake.cpp b/Source/modules/websockets/WebSocketHandshake.cpp |
index edb9a8d8bee71a929bca2cb0653d42c044e99915..dff022bae5673f6f95da436e173e6fc05ed55352 100644 |
--- a/Source/modules/websockets/WebSocketHandshake.cpp |
+++ b/Source/modules/websockets/WebSocketHandshake.cpp |
@@ -174,8 +174,11 @@ String WebSocketHandshake::clientOrigin() const |
String WebSocketHandshake::clientLocation() const |
{ |
StringBuilder builder; |
- builder.append(m_secure ? "wss" : "ws"); |
- builder.append("://"); |
+ if (m_secure) |
+ builder.appendLiteral("wss"); |
+ else |
+ builder.appendLiteral("ws"); |
+ builder.appendLiteral("://"); |
builder.append(hostName(m_url, m_secure)); |
builder.append(resourceName(m_url)); |
return builder.toString(); |
@@ -188,9 +191,9 @@ CString WebSocketHandshake::clientHandshakeMessage() const |
// Keep the following consistent with clientHandshakeRequest(). |
StringBuilder builder; |
- builder.append("GET "); |
+ builder.appendLiteral("GET "); |
builder.append(resourceName(m_url)); |
- builder.append(" HTTP/1.1\r\n"); |
+ builder.appendLiteral(" HTTP/1.1\r\n"); |
Vector<String> fields; |
fields.append("Upgrade: websocket"); |
@@ -221,10 +224,10 @@ CString WebSocketHandshake::clientHandshakeMessage() const |
for (size_t i = 0; i < fields.size(); i++) { |
builder.append(fields[i]); |
- builder.append("\r\n"); |
+ builder.appendLiteral("\r\n"); |
} |
- builder.append("\r\n"); |
+ builder.appendLiteral("\r\n"); |
return builder.toString().utf8(); |
} |