Fix: ACME directory URL redirects are not followed #77
+221
−44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partial fix for #75
Technically this PR fixes the general redirect aspects for the GET call in
acme.rs.As of now the POST from
acme.rswould still not be covered:https://github.com/nginx/nginx-acme/blob/main/src/acme.rs#L181
Based on my testing this should only affect use-cases where URLs (relative, or absolute) are returned, that cause another redirect, which should be rarely the case (at least not in the environments I tested with). Reason being, that the URLs provided by
https://acme.example.com/directoryshould normally be OK not requiring redirects.Also I'm not completely sure how to best implement the requirements for
RFC 8555 §6.2.I can add those as well if needed, though it might be best to extract part of the redirect functionality to it's own (reusable) unit I assume.
Any opinions on this matter?
IMO this basic PR should already cover a few additional standard use cases, such as:
https://acme.example.com/directory->https://acme.example.com/some-id/directory(from ACME directory URL redirects are not followed #75)