Skip to content

Commit

Permalink
Merge pull request #191 from mmd-osm/patch/wwwauthheaders
Browse files Browse the repository at this point in the history
Reorder WWW-Authenticate headers to work around non-compliant clients
  • Loading branch information
mmd-osm authored May 30, 2019
2 parents dd5219a + 91dbf32 commit 5b10768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/process_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ void respond_401(const http::unauthorized &e, request &r) {

r.status(e.code());
r.add_header("Content-Type", "text/plain; charset=utf-8");
r.add_header("WWW-Authenticate", R"(OAuth realm="OpenStreetMap login required")");
// Header according to RFC 7617, section 2.1
r.add_header("WWW-Authenticate", R"(Basic realm="OpenStreetMap login required", charset="UTF-8")");
r.add_header("WWW-Authenticate", R"(OAuth realm="OpenStreetMap login required")");
r.add_header("Content-Length", message_size.str());
r.add_header("Cache-Control", "no-cache");

Expand Down

0 comments on commit 5b10768

Please sign in to comment.