Set Content-Type for JSON 401 response
This commit is contained in:
parent
c1a8723b90
commit
fe55ba3567
|
@ -226,10 +226,15 @@ sub do {
|
|||
if ( !$self->conf->{noAjaxHook} and $req->wantJSON ) {
|
||||
$self->logger->debug('Processing to JSON response');
|
||||
if ( ( $err > 0 and !$req->id ) or $err eq PE_SESSIONNOTGRANTED ) {
|
||||
my $s = qq'{"result":0,"error":$err}';
|
||||
return [
|
||||
401,
|
||||
[ 'WWW-Authenticate' => "SSO " . $self->conf->{portal} ],
|
||||
[qq'{"result":0,"error":$err}']
|
||||
[
|
||||
'WWW-Authenticate' => "SSO " . $self->conf->{portal},
|
||||
'Content-Type' => 'application/json',
|
||||
'Content-Length' => length($s)
|
||||
],
|
||||
[$s]
|
||||
];
|
||||
}
|
||||
elsif ( $err > 0 and $err != PE_PASSWORD_OK ) {
|
||||
|
|
Loading…
Reference in New Issue