Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Location: handling into ne_request, mostly obsoleting the ne_redirect API #152

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

notroj
Copy link
Owner

@notroj notroj commented Apr 27, 2024

Add ne_get_response_location(). Set descriptive errors for 3xx responses with a Location header.

* src/ne_request.c (ne_get_response_location): New function.
  (ne_end_request): Set descriptive error for a redirect.

* src/ne_redirect.c (create, post_send, free_redirect, ne_redirect_register): Rewritten as a simple cache of the URI returned by ne_get_response_location. Handle any 3xx response.

* src/ne_redirect.h: Note API is deprecated.

* src/ne_request.h: Describe ne_get_response_location.

* test/request.c (redirect_error): New test.

* test/redirect.c (serve_redir): Removed. (check_redir, redirects): Simplify, and enhance to test ne_get_response_location() directly. Add more relative URI checks and fragment handling.

ne_redirect.h API. Add ne_get_response_location(). Set descriptive
errors for 3xx responses with a Location header. NE_REDIRECT
is returned for any 3xx response if ne_redirect API is used.

* src/ne_request.c (ne_get_response_location): New function.
  (ne_end_request): Set descriptive error for a redirect.

* src/ne_redirect.c (create, post_send, free_redirect,
  ne_redirect_register): Rewritten as a simple cache of the URI
  returned by ne_get_response_location. Handle any 3xx response.

* src/ne_redirect.h: Note API is deprecated.

* src/ne_request.h: Describe ne_get_response_location.

* test/request.c (redirect_error): New test.

* test/redirect.c (serve_redir): Removed.
  (check_redir, redirects): Simplify, and enhance to test
  ne_get_response_location() directly. Add more relative URI
  checks and fragment handling.
@notroj notroj merged commit 2931acd into master Apr 27, 2024
196 checks passed
@notroj notroj deleted the redirect-api branch April 27, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant