summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2021-02-07 01:54:46 +1300
committerTom Ryder <tom@sanctum.geek.nz>2021-02-07 01:54:46 +1300
commit2bea92342d3c58ba197c00fff237f0e202f671c6 (patch)
treedc91132dac4150e268c2c83976ec1223f09cd1be
parentRemove MYMETA.* from MANIFEST (diff)
downloadPOE-Component-Client-WebSocket-2bea92342d3c58ba197c00fff237f0e202f671c6.tar.gz
POE-Component-Client-WebSocket-2bea92342d3c58ba197c00fff237f0e202f671c6.zip
Use CRLF line endings in GET request
The HTTP::Request->as_string() method uses \n as an end-of-line token default. Apache HTTPD and Lua's http_server don't tolerate these as line endings, and throw 400 errors promptly. Providing CRLF explicitly as the end-of-line character makes the request palatable to these servers, and probably others with the same strictness.
-rw-r--r--lib/POE/Component/Client/WebSocket.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/POE/Component/Client/WebSocket.pm b/lib/POE/Component/Client/WebSocket.pm
index a78ba2e..e428672 100644
--- a/lib/POE/Component/Client/WebSocket.pm
+++ b/lib/POE/Component/Client/WebSocket.pm
@@ -467,7 +467,7 @@ sub _socket_birth {
$heap->{httpresp} = 1;
# Send the request to the server
- $heap->{wheel}->put($request->as_string());
+ $heap->{wheel}->put($request->as_string("\r\n"));
# Incase we want to investigate what we sent later.
$heap->{_state}->{req} = $request;