diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-07 16:31:35 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-08 16:52:48 +0300 |
commit | 72e6f27fce0193be5d1f2c15ca3123f9e33f2029 (patch) | |
tree | bf893bdef2e644a3b036a6dc7c9d56437c1773a7 /src/include | |
parent | 109311446eeecf5341b5f39a04016833c1ffc0d0 (diff) | |
download | libmicrohttpd-72e6f27fce0193be5d1f2c15ca3123f9e33f2029.tar.gz libmicrohttpd-72e6f27fce0193be5d1f2c15ca3123f9e33f2029.zip |
MHD_queue_basic_auth_fail_response3(): new function for RFC 7617 support
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/microhttpd.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index d6445b77..877201e2 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -96,7 +96,7 @@ extern "C" | |||
96 | * they are parsed as decimal numbers. | 96 | * they are parsed as decimal numbers. |
97 | * Example: 0x01093001 = 1.9.30-1. | 97 | * Example: 0x01093001 = 1.9.30-1. |
98 | */ | 98 | */ |
99 | #define MHD_VERSION 0x00097515 | 99 | #define MHD_VERSION 0x00097516 |
100 | 100 | ||
101 | /* If generic headers don't work on your platform, include headers | 101 | /* If generic headers don't work on your platform, include headers |
102 | which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', | 102 | which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', |
@@ -4648,6 +4648,39 @@ MHD_basic_auth_get_username_password (struct MHD_Connection *connection, | |||
4648 | 4648 | ||
4649 | 4649 | ||
4650 | /** | 4650 | /** |
4651 | * Queues a response to request basic authentication from the client. | ||
4652 | * | ||
4653 | * The given response object is expected to include the payload for | ||
4654 | * the response; the "WWW-Authenticate" header will be added and the | ||
4655 | * response queued with the 'UNAUTHORIZED' status code. | ||
4656 | * | ||
4657 | * See RFC 7617#section-2 for details. | ||
4658 | * | ||
4659 | * The @a response is modified by this function. The modified response object | ||
4660 | * can be used to respond subsequent requests by #MHD_queue_response() | ||
4661 | * function with status code #MHD_HTTP_UNAUTHORIZED and must not be used again | ||
4662 | * with MHD_queue_basic_auth_fail_response3() function. The response could | ||
4663 | * be destroyed right after call of this function. | ||
4664 | * | ||
4665 | * @param connection the MHD connection structure | ||
4666 | * @param realm the realm presented to the client | ||
4667 | * @param prefer_utf8 if not set to #MHD_NO, parameter'charset="UTF-8"' will | ||
4668 | * be added, indicating for client that UTF-8 encoding | ||
4669 | * is preferred | ||
4670 | * @param response the response object to modify and queue; the NULL | ||
4671 | * is tolerated | ||
4672 | * @return #MHD_YES on success, #MHD_NO otherwise | ||
4673 | * @note Available since #MHD_VERSION 0x00097516 | ||
4674 | * @ingroup authentication | ||
4675 | */ | ||
4676 | _MHD_EXTERN enum MHD_Result | ||
4677 | MHD_queue_basic_auth_fail_response3 (struct MHD_Connection *connection, | ||
4678 | const char *realm, | ||
4679 | int prefer_utf8, | ||
4680 | struct MHD_Response *response); | ||
4681 | |||
4682 | |||
4683 | /** | ||
4651 | * Queues a response to request basic authentication from the client | 4684 | * Queues a response to request basic authentication from the client |
4652 | * The given response object is expected to include the payload for | 4685 | * The given response object is expected to include the payload for |
4653 | * the response; the "WWW-Authenticate" header will be added and the | 4686 | * the response; the "WWW-Authenticate" header will be added and the |
@@ -4657,6 +4690,7 @@ MHD_basic_auth_get_username_password (struct MHD_Connection *connection, | |||
4657 | * @param realm the realm presented to the client | 4690 | * @param realm the realm presented to the client |
4658 | * @param response response object to modify and queue; the NULL is tolerated | 4691 | * @param response response object to modify and queue; the NULL is tolerated |
4659 | * @return #MHD_YES on success, #MHD_NO otherwise | 4692 | * @return #MHD_YES on success, #MHD_NO otherwise |
4693 | * @deprecated use MHD_queue_basic_auth_fail_response3() | ||
4660 | * @ingroup authentication | 4694 | * @ingroup authentication |
4661 | */ | 4695 | */ |
4662 | _MHD_EXTERN enum MHD_Result | 4696 | _MHD_EXTERN enum MHD_Result |