Permalink
Browse files

Item14445: Need to include a -status return

Fix unit tests that were expecting the 401.
  • Loading branch information...
gac410 committed Dec 18, 2017
1 parent fb45db2 commit 3f487ae34e832619b78f8c4e27228dc5002e1790
@@ -946,8 +946,8 @@ THIS
my ($status) = $text =~ m/^Status: (\d+)\r?$/m;
$this->assert_not_null( $status,
"Request did not return a Status header" );
$this->assert_equals( 401, $status,
"Request should have returned a 401, not a $status" );
$this->assert_equals( 200, $status,
"Request should have returned a 200, not a $status" );
# Extract what we've been redirected to
my ($formAction) =
@@ -811,8 +811,8 @@ THIS
# Check we got a 401
my ($status) = $text =~ m/^Status: (\d+)\r?$/m;
$this->assert_not_null( $status, "Request did not return a Status header" );
$this->assert_equals( 401, $status,
"Request should have returned a 401, not a $status" );
$this->assert_equals( 200, $status,
"Request should have returned a 200, not a $status" );
# Extract what we've been redirected to
my ($formAction) =
@@ -93,6 +93,18 @@ sub forceAuthentication {
my $query = $session->{request};
my $response = $session->{response};
# SMELL: This breaks some applications such as MS Excel. Return
# A 200 instead of a 401.
# Respond with a 401 with an appropriate WWW-Authenticate
# that won't be snatched by the browser, but can be used
# by JS to generate login info.
$response->header(
-status => 200,
#-WWW_Authenticate => 'FoswikiBasic realm="'
# . ( $Foswiki::cfg{AuthRealm} || "" ) . '"'
);
$query->param(
-name => 'foswiki_origin',
-value => _packRequest($session)

0 comments on commit 3f487ae

Please sign in to comment.