Skip to content

Commit fa44a18

Browse files
committed
webdav: fix digest auth
1 parent 5f61ff9 commit fa44a18

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

libretro-common/include/net/net_http.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ bool net_http_error(struct http_t *state);
103103
*
104104
* @return the response headers. The returned buffer is owned by the
105105
* caller of net_http_new; it is not freed by net_http_delete.
106-
* If the status is not 20x and accept_error is false, it returns NULL.
106+
* On a transport error, NULL is returned unless accept_error is true.
107+
* Headers are returned for any response that was parsed successfully,
108+
* including HTTP error statuses such as 401 (needed for auth challenges).
107109
**/
108110
struct string_list *net_http_headers(struct http_t *state);
109111
struct string_list *net_http_headers_ex(struct http_t *state, bool accept_error);

libretro-common/net/net_http.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,13 +1804,15 @@ int net_http_status(struct http_t *state)
18041804
*
18051805
* @return the response headers. The returned buffer is owned by the
18061806
* caller of net_http_new; it is not freed by net_http_delete().
1807-
* If the status is not 20x and accept_err is false, it returns NULL.
1807+
* On a transport error, NULL is returned unless accept_err is true.
1808+
* Headers are returned for any response that was parsed successfully,
1809+
* including HTTP error statuses such as 401 (needed for auth challenges).
18081810
**/
18091811
struct string_list *net_http_headers_ex(struct http_t *state, bool accept_err)
18101812
{
18111813
if (!state)
18121814
return NULL;
1813-
if (!accept_err && !state->err)
1815+
if (!accept_err && state->err)
18141816
return NULL;
18151817
return state->response.headers;
18161818
}

0 commit comments

Comments
 (0)