sanity checking proxy URL before passing to LWP

B

buildmorelines

What is the best/normal/typical way of validating or sanity checking a
URL that a user gave that will become the proxy address that will get
passed to LWP, I would prefer modules if possible? If it isnt
acceptable to let LWP error with "501 Protocol scheme '' is not
supported".

Also are there any modules that will turn something like "localhost"
into "http://localhost/" because LWP says "501 Protocol scheme '' is
not supported" if I just give it "localhost". Also do I need to worry
about https addresses?

Would all of I want to do work by making a regular expression such as
m/http(|s):\/\/.+/i (invented myself)?
 
A

A. Sinan Unur

(e-mail address removed) (buildmorelines) wrote in
What is the best/normal/typical way of validating or sanity checking a
URL that a user gave that will become the proxy address that will get
passed to LWP, I would prefer modules if possible?

Search CPAN for Regexp::Common.
Would all of I want to do work by making a regular expression such as
m/http(|s):\/\/.+/i (invented myself)?

I am not sure what you mean?

Sinan.
 
B

buildmorelines

A. Sinan Unur said:
(e-mail address removed) (buildmorelines) wrote in


Search CPAN for Regexp::Common.


I am not sure what you mean?

Sinan.

Should I simple make my own regexp to make sure the URL supplied is a
valid proxy address by simple checking for "http://" or
/^http:\/\/.+/?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top