summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-09-09 21:21:37 +0200
committerjospaeth <spaethj@in.tum.de>2020-09-09 21:21:37 +0200
commitf4a58f964dc53c139ac30b8da8ffa93e838590af (patch)
tree9512203a198776fd9bf691bcce18349346cb67a1
parentd391974aeba2f6778e701db32029404d286d3b4e (diff)
fix response code for error case
-rw-r--r--src/escrow/plugin_rest_escrow.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/escrow/plugin_rest_escrow.c b/src/escrow/plugin_rest_escrow.c
index 917d0cdca..c5c4dbaf8 100644
--- a/src/escrow/plugin_rest_escrow.c
+++ b/src/escrow/plugin_rest_escrow.c
@@ -417,6 +417,7 @@ get_user_secret_from_payload (struct RequestHandle *handle)
if (0 >= handle->data_size)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_NO_DATA);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
return NULL;
}
@@ -427,6 +428,7 @@ get_user_secret_from_payload (struct RequestHandle *handle)
if (NULL == json_data)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_NO_DATA);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
json_decref (json_data);
return NULL;
@@ -439,6 +441,7 @@ get_user_secret_from_payload (struct RequestHandle *handle)
if (0 != json_unpack_state)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_DATA_INVALID);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
json_decref (json_data);
return NULL;
@@ -447,6 +450,7 @@ get_user_secret_from_payload (struct RequestHandle *handle)
if (NULL == user_secret)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_DATA_INVALID);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
json_decref (json_data);
return NULL;
@@ -455,6 +459,7 @@ get_user_secret_from_payload (struct RequestHandle *handle)
{
json_decref (json_data);
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_DATA_INVALID);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
return NULL;
}
@@ -601,6 +606,7 @@ get_anchor_from_payload (struct RequestHandle *handle)
if (0 >= handle->data_size)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_NO_DATA);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
return NULL;
}
@@ -611,6 +617,7 @@ get_anchor_from_payload (struct RequestHandle *handle)
if (NULL == json_data)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_NO_DATA);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
json_decref (json_data);
return NULL;
@@ -623,6 +630,7 @@ get_anchor_from_payload (struct RequestHandle *handle)
if (0 != json_unpack_state)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_DATA_INVALID);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
json_decref (json_data);
return NULL;
@@ -631,6 +639,7 @@ get_anchor_from_payload (struct RequestHandle *handle)
if (NULL == anchor_string)
{
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_DATA_INVALID);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
json_decref (json_data);
return NULL;
@@ -639,6 +648,7 @@ get_anchor_from_payload (struct RequestHandle *handle)
{
json_decref (json_data);
handle->emsg = GNUNET_strdup (GNUNET_REST_ERROR_DATA_INVALID);
+ handle->response_code = MHD_HTTP_BAD_REQUEST;
GNUNET_SCHEDULER_add_now (&do_error, handle);
return NULL;
}