Skip Menu |

This queue is for tickets about the WebService-Validator-HTML-W3C CPAN distribution.

Report information
The Basics
Id: 17939
Status: resolved
Priority: 0/
Queue: WebService-Validator-HTML-W3C

People
Owner: struan [...] cpan.org
Requestors: c.a.vincent [...] ncl.ac.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.1
  • 0.11
Fixed in: 0.12



Subject: Option to use a HTTP proxy
We need to access the validation service through a HTTP proxy. I guess that's a need other people might add. Hopefully you'll consider adding this to the released module. Since the LWP::UserAgent isn't exposed through the API, we've modified the W3C object to have another attribute: proxy which is applied to the UserAgent object within the code. A patch file is attached for application to version 0.11. Seems to work OK on perl-5.8.7. Thanks for the useful module. Carl Carl Vincent Systems Manager Netskills www.netskills.ac.uk
Subject: diff.txt
*** W3C.pm 2006-03-02 15:46:29.000000000 +0000 --- W3C-011.pm 2006-02-25 19:34:48.000000000 +0000 *************** *** 10,16 **** use WebService::Validator::HTML::W3C::Error; __PACKAGE__->mk_accessors( ! qw( http_timeout validator_uri proxy _http_method is_valid num_errors uri _content _output ) ); use vars qw( $VERSION $VALIDATOR_URI $HTTP_TIMEOUT ); --- 10,16 ---- use WebService::Validator::HTML::W3C::Error; __PACKAGE__->mk_accessors( ! qw( http_timeout validator_uri _http_method is_valid num_errors uri _content _output ) ); use vars qw( $VERSION $VALIDATOR_URI $HTTP_TIMEOUT ); *************** *** 71,80 **** The URI of the validator to use. By default this accesses the W3Cs validator at http://validator.w3.org/check. If you have a local installation of the validator ( recommended if you wish to do a lot of testing ) or wish to use a validator at another location then you can use this option. Please note that you need to use the full path to the validator cgi. - =item proxy - - A HTTP proxy to use when communicating with the validation service. - =item http_timeout How long (in seconds) to wait for the HTTP connection to timeout when --- 71,76 ---- *************** *** 113,119 **** $self->validator_uri( $args{validator_uri} || $VALIDATOR_URI ); $self->_http_method( $args{detailed} ? 'GET' : 'HEAD' ); $self->_output( $args{output} || 'xml' ); - $self->proxy( $args{proxy} || '' ); } =head2 validate --- 109,114 ---- *************** *** 179,186 **** my $ua = LWP::UserAgent->new( agent => __PACKAGE__ . "/$VERSION", timeout => $self->http_timeout ); - if ($self->{proxy}) { $ua->proxy( $self->{proxy} ); } - my $request = $self->_get_request( $uri ); my $response = $ua->simple_request($request); --- 174,179 ----
From: c.a.vincent [...] ncl.ac.uk
In far too much of a hurry - attached a diff from a previous version that didn't work. This one does.... Carl
*** W3C.pm 2006-03-02 17:02:07.000000000 +0000 --- W3C-011.pm 2006-02-25 19:34:48.000000000 +0000 *************** *** 10,16 **** use WebService::Validator::HTML::W3C::Error; __PACKAGE__->mk_accessors( ! qw( http_timeout validator_uri proxy _http_method is_valid num_errors uri _content _output ) ); use vars qw( $VERSION $VALIDATOR_URI $HTTP_TIMEOUT ); --- 10,16 ---- use WebService::Validator::HTML::W3C::Error; __PACKAGE__->mk_accessors( ! qw( http_timeout validator_uri _http_method is_valid num_errors uri _content _output ) ); use vars qw( $VERSION $VALIDATOR_URI $HTTP_TIMEOUT ); *************** *** 71,80 **** The URI of the validator to use. By default this accesses the W3Cs validator at http://validator.w3.org/check. If you have a local installation of the validator ( recommended if you wish to do a lot of testing ) or wish to use a validator at another location then you can use this option. Please note that you need to use the full path to the validator cgi. - =item proxy - - A HTTP proxy to use when communicating with the validation service. - =item http_timeout How long (in seconds) to wait for the HTTP connection to timeout when --- 71,76 ---- *************** *** 113,119 **** $self->validator_uri( $args{validator_uri} || $VALIDATOR_URI ); $self->_http_method( $args{detailed} ? 'GET' : 'HEAD' ); $self->_output( $args{output} || 'xml' ); - $self->proxy( $args{proxy} || '' ); } =head2 validate --- 109,114 ---- *************** *** 179,186 **** my $ua = LWP::UserAgent->new( agent => __PACKAGE__ . "/$VERSION", timeout => $self->http_timeout ); - if ($self->{proxy}) { $ua->proxy( 'http',$self->{proxy} ); } - my $request = $self->_get_request( $uri ); my $response = $ua->simple_request($request); --- 174,179 ----
Subject: Re: [rt.cpan.org #17939] Option to use a HTTP proxy
Date: Fri, 3 Mar 2006 09:54:14 +0000
To: Guest via RT <bug-WebService-Validator-HTML-W3C [...] rt.cpan.org>
From: Struan Donald <struan [...] exo.org.uk>
* at 02/03 12:03 -0500 Guest via RT said: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=17939 > > > In far too much of a hurry - attached a diff from a previous version > that didn't work. This one does....
Cool, Thanks for this. I'll stick them in and shove a new release up sometime in the next week or so. Struan
Ok, This should now be fixed in version 0.12 which is now winging its way to CPAN.