Skip to content

Commit

Permalink
release 1.4.5.4: revert header_add/header_set change
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Jan 21, 2023
1 parent 31cf194 commit 003fb41
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
01/21/2023
- revert header_add/header_set change
- release 1.4.5.4

01/20/2023
- don't add WWW-Authenticate header(s) but (over)write a single one; see zmartzone/mod_oauth2#42
- release 1.4.5.3
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([liboauth2],[1.4.5.3],[[email protected]])
AC_INIT([liboauth2],[1.4.5.4],[[email protected]])

AM_INIT_AUTOMAKE([foreign no-define subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
Expand Down
2 changes: 1 addition & 1 deletion include/oauth2/apache.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ int oauth2_apache_return_www_authenticate(oauth2_cfg_source_token_t *cfg,
const char *error_description);
bool oauth2_apache_request_header_set(oauth2_log_t *log, void *rec,
const char *name, const char *value);
void oauth2_apache_hdr_out_set(oauth2_log_t *log, const request_rec *r,
void oauth2_apache_hdr_out_add(oauth2_log_t *log, const request_rec *r,
const char *name, const char *value);
void oauth2_apache_scrub_headers(oauth2_apache_request_ctx_t *ctx,
oauth2_cfg_target_pass_t *target_pass);
Expand Down
3 changes: 2 additions & 1 deletion include/oauth2/oauth2.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
#define OAUTH2_ERROR_INVALID_TOKEN "invalid_token"
#define OAUTH2_ERROR_INVALID_REQUEST "invalid_request"
#define OAUTH2_ERROR_INSUFFICIENT_SCOPE "insufficient_scope"
#define OAUTH2_ERROR_INSUFFICIENT_USER_AUTHENTICATION "insufficient_user_authentication"
#define OAUTH2_ERROR_INSUFFICIENT_USER_AUTHENTICATION \
"insufficient_user_authentication"

#define OAUTH2_CLAIM_ISS "iss"
#define OAUTH2_CLAIM_SUB "sub"
Expand Down
12 changes: 6 additions & 6 deletions src/server/apache.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ int oauth2_apache_return_www_authenticate(oauth2_cfg_source_token_t *cfg,
hdr = apr_psprintf(ctx->r->pool, "%s, %s=\"%s\"", hdr,
OAUTH2_ERROR_DESCRIPTION, error_description);

oauth2_apache_hdr_out_set(ctx->log, ctx->r,
oauth2_apache_hdr_out_add(ctx->log, ctx->r,
OAUTH2_HTTP_HDR_WWW_AUTHENTICATE, hdr);

oauth2_debug(ctx->log, "leave");
Expand Down Expand Up @@ -423,11 +423,11 @@ bool oauth2_apache_http_request_set(oauth2_log_t *log,
return rc;
}

bool oauth2_apache_response_header_set(oauth2_log_t *log, void *rec,
bool oauth2_apache_response_header_add(oauth2_log_t *log, void *rec,
const char *name, const char *value)
{
request_rec *r = (request_rec *)rec;
oauth2_apache_hdr_out_set(log, r, name, value);
oauth2_apache_hdr_out_add(log, r, name, value);
return true;
}

Expand All @@ -441,7 +441,7 @@ bool oauth2_apache_http_response_set(oauth2_log_t *log,
goto end;

oauth2_http_response_headers_loop(log, response,
oauth2_apache_response_header_set, r);
oauth2_apache_response_header_add, r);

r->status = oauth2_http_response_status_code_get(log, response);

Expand All @@ -452,11 +452,11 @@ bool oauth2_apache_http_response_set(oauth2_log_t *log,
return rc;
}

void oauth2_apache_hdr_out_set(oauth2_log_t *log, const request_rec *r,
void oauth2_apache_hdr_out_add(oauth2_log_t *log, const request_rec *r,
const char *name, const char *value)
{
oauth2_debug(log, "%s: %s", name, value);
apr_table_set(r->err_headers_out, name, value);
apr_table_add(r->err_headers_out, name, value);
}

void oauth2_apache_scrub_headers(oauth2_apache_request_ctx_t *ctx,
Expand Down

0 comments on commit 003fb41

Please sign in to comment.