summaryrefslogtreecommitdiff
path: root/src/backend/taler-mint-httpd_responses.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-mint-httpd_responses.c')
-rw-r--r--src/backend/taler-mint-httpd_responses.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/backend/taler-mint-httpd_responses.c b/src/backend/taler-mint-httpd_responses.c
index aa8f0bf8..70cf7e52 100644
--- a/src/backend/taler-mint-httpd_responses.c
+++ b/src/backend/taler-mint-httpd_responses.c
@@ -165,4 +165,25 @@ TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
"invalid json");
}
+/**
+ * Add headers we want to return in every response.
+ * Useful for testing, like if we want to always close
+ * connections.
+ *
+ * @param response response to modify
+ */
+void
+TMH_RESPONSE_add_global_headers (struct MHD_Response *response)
+{
+ int TMH_mint_connection_close;
+ TMH_mint_connection_close = 0;
+
+ /* this test is taken verbatim from the mint's code,
+ so there is no particular need to do that for a merchant */
+ if (TMH_mint_connection_close)
+ (void) MHD_add_response_header (response,
+ MHD_HTTP_HEADER_CONNECTION,
+ "close");
+}
+
/* end of taler-mint-httpd_responses.c */