Skip to content

Commit 850b2ec

Browse files
author
Hans Zandbelt
committed
avoid using json_object_foreach to allow builds with older libjansson
1 parent b2f7188 commit 850b2ec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/metadata.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,13 @@ static apr_byte_t oidc_metadata_client_register(request_rec *r, oidc_cfg *cfg,
656656

657657
const char *key;
658658
json_t *value;
659-
json_object_foreach(json, key, value) {
659+
660+
void *iter = json_object_iter(json);
661+
while(iter) {
662+
key = json_object_iter_key(iter);
663+
value = json_object_iter_value(iter);
660664
json_object_set(data, key, value);
665+
iter = json_object_iter_next(json, iter);
661666
}
662667

663668
}

0 commit comments

Comments
 (0)