Permalink
Browse files

Added onion_response_get_headers, that return current header dictiona…

…ry for user custom management.
  • Loading branch information...
1 parent 669eec3 commit 75f50693be5d6a8a19044b58603909ae0c4c7bc3 @davidmoreno committed Aug 1, 2012
Showing with 12 additions and 0 deletions.
  1. +10 −0 src/onion/response.c
  2. +2 −0 src/onion/response.h
View
@@ -411,3 +411,13 @@ void onion_response_set_writer(onion_response *res, onion_write write, void *soc
res->write=write;
res->socket=socket;
}
+
+/**
+ * @short Returns the headers dictionary, so user can add repeated headers
+ *
+ * Only simple use case is to add several coockies; using normal set_header is not possible,
+ * but accessing the dictionary user can add repeated headers without problem.
+ */
+onion_dict *onion_response_get_headers(onion_response *res){
+ return res->headers;
+}
View
@@ -90,6 +90,8 @@ void onion_response_set_header(onion_response *res, const char *key, const char
void onion_response_set_length(onion_response *res, size_t length);
/// Sets the return code
void onion_response_set_code(onion_response *res, int code);
+/// Gets the headers dictionary
+onion_dict *onion_response_get_headers(onion_response *res);
/// @{ @name Write functions
/// Writes all the header to the given fd

0 comments on commit 75f5069

Please sign in to comment.