5 #include "http_config.h"
7 #include "http_protocol.h"
8 //#include "apr_compat.h"
9 #include "apr_strings.h"
10 #include "apr_reslist.h"
14 #include "opensrf/string_array.h"
15 #include "opensrf/utils.h"
16 #include "opensrf/log.h"
22 #define APACHE_TOOLS_MAX_POST_SIZE 10485760 /* 10 MB */
23 #define OSRF_HTTP_ALL_HEADERS "X-OpenSRF-to,X-OpenSRF-xid,X-OpenSRF-from,X-OpenSRF-thread,X-OpenSRF-timeout,X-OpenSRF-service,X-OpenSRF-multipart"
26 /* parses apache URL params (GET and POST).
27 Returns a osrfStringArray of the form [ key, val, key, val, ...]
28 Returns NULL if there are no params */
29 osrfStringArray* apacheParseParms(request_rec* r);
31 /* provide the params string array, and this will generate a
32 string of array of param keys
33 the returned osrfStringArray most be freed by the caller
35 osrfStringArray* apacheGetParamKeys(osrfStringArray* params);
37 /* provide the params string array and a key name, and
38 this will provide the value found for that key
39 the returned osrfStringArray most be freed by the caller
41 osrfStringArray* apacheGetParamValues(osrfStringArray* params, char* key);
43 /* returns the first value found for the given param.
44 char* must be freed by the caller */
45 char* apacheGetFirstParamValue(osrfStringArray* params, char* key);
47 /* Writes msg to stderr, flushes stderr, and returns 0 */
48 int apacheDebug( char* msg, ... );
50 /* Writes to stderr, flushe stderr, and returns HTTP_INTERNAL_SERVER_ERROR;
52 int apacheError( char* msg, ... );
54 /* Set headers for Cross Origin Resource Sharing requests
55 as per W3 standard http://www.w3.org/TR/cors/ */
56 int crossOriginHeaders(request_rec* r, osrfStringArray* allowedOrigins);
59 * Creates an apache table* of cookie name / value pairs
62 apr_table_t* apacheParseCookies(request_rec *r);