sanity checking proxy URL before passing to LWP

Discussion in 'Perl Misc' started by buildmorelines, Nov 6, 2004.

  1. 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)?
    buildmorelines, Nov 6, 2004
    #1
    1. Advertising

  2. (buildmorelines) wrote in
    news::

    > 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.
    A. Sinan Unur, Nov 6, 2004
    #2
    1. Advertising

  3. "A. Sinan Unur" <> wrote in message news:<Xns9598DB3B5F3C3asu1cornelledu@132.236.56.8>...
    > (buildmorelines) wrote in
    > news::
    >
    > > 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.


    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:\/\/.+/?
    buildmorelines, Nov 6, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Woogie

    LWP with proxy problem

    Woogie, Dec 20, 2003, in forum: Perl
    Replies:
    1
    Views:
    996
    Roy Johnson
    Dec 22, 2003
  2. demonhunter
    Replies:
    3
    Views:
    2,103
  3. Great Deals
    Replies:
    1
    Views:
    105
  4. Woogie

    LWP with proxy problem

    Woogie, Dec 23, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    180
    Woogie
    Dec 27, 2003
  5. Mike

    Proxy and LWP::UserAgent

    Mike, Jun 27, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    121
    RedGrittyBrick
    Jun 30, 2005
Loading...

Share This Page