in reply to [Mason] Sending right header to force http basic authentication

See this section of the Mason documentation.

Perhaps semething like this:

<%perl> $m->autoflush(0); $m->clear_buffer(); $r->header_out->add("WWW-Authenticate" => 'Basic realm="RealmChain"'); $r->send_http_header(); $m->abort("401 Unauthorized"); </%perl>
  • Comment on Re: [Mason] Sending right header to force http basic authentication
  • Download Code

Replies are listed 'Best First'.
Re^2: [Mason] Sending right header to force http basic authentication
by johnnywang (Priest) on Nov 26, 2005 at 20:47 UTC
    This doesn't seem to work. Although abort() forced the correct status (401), it somehow removed the WWW-Authenticate header:
    $r->header_out->add("WWW-Authenticate" => 'Basic realm="RealmChain"'); $r->send_http_header();
      try : $r->err_header_out instead of $r->header_out
        Great ! It just work as I want with err_header !! Thx a lot.

        -- Nice photos of naked perl sources here !