Skip Menu |

This queue is for tickets about the HTTP-Parser CPAN distribution.

Report information
The Basics
Id: 7654
Status: resolved
Priority: 0/
Queue: HTTP-Parser

People
Owner: Nobody in particular
Requestors: mfr [...] hybyte.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.02
Fixed in: 0.02



Subject: parse response, continued
Sorry, I know I am just breking rules, by using a 2nd bug. I was expecting an "add note" on my previous one, but couldnt find it) Here is the subclass for respnses package Http::Parser::Response; use base qw/ Http::Parser /; use HTTP::Response; sub _get_http_obj { my $self = shift; return HTTP::Response->new(@_); } sub _parse_first_header_line { my ($self, $request) = @_; my ($http, $state, $msg) = split / /,$request; die "bad response line '$request'" unless $http and $http =~ /^HTTP\/(\d+)\.(\d+)$/i; my ($major,$minor) = ($1,$2); my $req = $self->_get_http_obj($state, $msg); $req->header(X_HTTP_Version => "$major.$minor"); # pseudo-header return $req; } 1;
Added to 0.03, with credit, although I didn't implement it as a subclass, rather added the ability to parse responses to the base class.