dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #51072
Re: API not showing 401 Unauthorized error
By the way, its not just the error response code that is worrying, but also
the loop of redirects that starts, this makes it difficult to handle the
response for an http client. To see this loop of redirects, you can add -L
to curl as below.
curl -I -L -u admin:distric -H 'Accept: application/json'
https://play.dhis2.org/2.28/api/me
I think this behaviour should be corrected as it may lead to unexpected
behaviour of apps.
Regards
On Wed, Apr 18, 2018 at 11:10 PM, Rangarirai Matavire <matavirer@xxxxxxxxx>
wrote:
> Hi Devs,
>
> I am wondering whether the behaviour I am seeing is a bug or something to
> be expected due to some change.
>
> When I run the following curl command:
>
> curl -I -u admin:distric -H 'Accept: application/json'
> https://play.dhis2.org/2.29/api/me
>
> I get an HTTP 302 response. Note that I have deliberately set the password
> wrong so I can mock a 401 unauthorized response. I get the same response
> when I run the command on version 2.28. However, as expected, when I run it
> on 2.27, 2.26 etc I get a 401 HTTP response.
>
> I hope someone can assist.
>
> Regards,
>
> Ranga
>
Follow ups
References