Subject: | Net::Server::HTTP only ever returns status 200 |
Net::Server::HTTP will only return an HTTP status of 200 OK. (Alright,
that's not true. If you try to return the header "HTTP/1.0 200 OK\n\n"
the server will give an error saying it couldn't recognize any headers).
The problem is with the regular expression used to match the status
line. It attempts to match a literal space, followed by one or more
spaces, followed by a number followed by at least two literal spaces or
three literal spaces and a message. The attached patch resolves the issue.
Subject: | HTTP.pm.patch |
93c93
< if ($headers =~ m{^HTTP/1.[01] \s+ \d+ (?: | \s+ .+)\r?\n}) {
---
> if ($headers =~ m{^HTTP/1.[01]\s\d+ (.+)?\r?\n}) {