OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 if (m_clientProtocol.isEmpty()) { | 541 if (m_clientProtocol.isEmpty()) { |
542 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P
rotocol mismatch"; | 542 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P
rotocol mismatch"; |
543 return false; | 543 return false; |
544 } | 544 } |
545 Vector<String> result; | 545 Vector<String> result; |
546 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result
); | 546 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result
); |
547 if (!result.contains(serverWebSocketProtocol)) { | 547 if (!result.contains(serverWebSocketProtocol)) { |
548 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P
rotocol mismatch"; | 548 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P
rotocol mismatch"; |
549 return false; | 549 return false; |
550 } | 550 } |
| 551 } else if (!m_clientProtocol.isEmpty()) { |
| 552 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Proto
col mismatch"; |
| 553 return false; |
551 } | 554 } |
552 return true; | 555 return true; |
553 } | 556 } |
554 | 557 |
555 } // namespace WebCore | 558 } // namespace WebCore |
OLD | NEW |