Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-2269

regex_remap plugin has problem handling the case when url path is empty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.1.2
    • Plugins
    • None

    Description

      Specifically the block of code is here - https://github.com/apache/trafficserver/blob/master/plugins/regex_remap/regex_remap.cc#L802-806

      *(match_buf + match_len) = '/';
      if (req_url.path && req_url.path_len > 0)

      { memcpy(match_buf + match_len + 1, req_url.path, req_url.path_len); match_len += (req_url.path_len + 1); }

      So if req_url.path is empty (e.g. in the case of http://www.xyx.com/ being the request url), match_len will not increment by 1.

      so e.g. there won't be a match for this case for the regular expression of '^/$'

      Attachments

        1. regex_remap.diff
          0.5 kB
          Shu Kit Francis Chan

        Activity

          People

            zwoop Leif Hedstrom
            kichan Shu Kit Francis Chan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: