Hello,

The other day the regex remap plugin was kindly updated to support redirects.  
One more feature of the plugin I was trying to use was for handling full urls.  
The docs say this is configurable via the param @pparam=[no-]full-url. This 
seems to have been stripped out now.  There is no attempt being made to read 
this param.  I tried unsuccessfully to add it by modifying the method 
TSRemapNewInstance to read the param


else if (strncmp(argv[i], "full-path", 9) == 0) {
      ri->fullpath = true;
    } else if (strncmp(argv[i], "no-full-path", 12) == 0) {
      ri->fullpath = false;
    }


Then in TSRemapDoRemap added the following snippet
  if (ri->fullpath) {
    if (match_len > 0)
    {
          *(match_buf + match_len) = ' ';
      match_len++;
    }
    memcpy(match_buf + match_len , req_url.host, req_url.host_len);
    match_len += (req_url.host_len);
  }

But the result is the rewritten host gets appended to the original host.  Is 
there a better way to do this by using some struct instead of building up a 
char array? 


Thanks,
Elli

Reply via email to