GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — WebSocketClient silently drops query string from URL during handshake · Issue #2468 · yhirose/cpp-httplib Closed DescriptionDescription
Instead of the expected: This violates RFC 6455 §4.1 which states the Request-URI must include the resource name (path + query). Steps to Reproducehttplib::ws::WebSocketClient ws( "wss://example.com/api/v1?token=ABC&session=123", {}); // ws.connect() sends: // GET /api/v1 HTTP/1.1 // // Expected: // GET /api/v1?token=ABC&session=123 HTTP/1.1 Any WebSocket server that requires query parameters for authentication or routing will reject the connection (typically 401 or 403). Root CauseIn the path_ = std::move(uc.path);
// uc.query is available here but never usedAnd in std::string req_str = "GET " + path + " HTTP/1.1\r\n"; // path has no query string Suggested FixAppend the query string to path_ = std::move(uc.path); if (!uc.query.empty()) { path_ += uc.query; }
Affected VersionsVerified in v0.46.0 and v0.46.1. Also present on current WorkaroundApply the one-line patch above, or avoid query parameters in WebSocket URLs (not always possible — some servers require auth tokens in query params). Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |