SHARE
TWEET

Untitled

a guest Jan 24th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char* set_location_with_param(void *sp, const char *key, const char *value){
  2.         const char *key_value_separator = "=";
  3.         const char *req_url = VRT_r_req_url(sp);
  4.         const char *req_host = VRT_GetHdr(sp, HDR_REQ, "05Host:");
  5.         const char *param_separator = strchr(req_url, '?') ? "&" : "?";
  6.         char *query_string = malloc(strlen(param_separator) + strlen(key) + strlen(key_value_separator) + strlen(value) + 1);
  7.         if(query_string != NULL){
  8.             strcpy(query_string, param_separator);
  9.             strcat(query_string, key);
  10.             strcat(query_string, key_value_separator);
  11.             strcat(query_string, value);
  12.             VRT_SetHdr(sp, HDR_OBJ, "11Location:", "https://", req_host, req_url, query_string, vrt_magic_string_end);
  13.             free(query_string);
  14.         }
  15.     }
  16.    
  17. if (obj.status == somevalue) {
  18.     C{set_location_with_param(sp, "something", "somethingelse");}C
  19.     set obj.status = 302;
  20.     return(deliver);
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top