rails request.request_uri should show parameters?

Discussion in 'Bug Reports' started by joost, May 17, 2007.

  1. joost

    joost Member

    Not sure if this is a bug, but LiteSpeed behaviour is different from Mongrel/Webrick and Rails documentation.

    Rails docu states that GET query parameters are included in request.request_uri. This happens with Mongrel. This does not happen in LiteSpeed.

    Mongrel: path /articles?type=A request_uri /articles?type=A
    LiteSpeed: path /articles?type=A request_uri /articles

    It causes problems with the current_page? method.

    Rails 1.2.3
    RESTful controller
    LiteSpeed 3.1.1-std
    Rails lsapi
    Linux 32-bit
  2. mistwang

    mistwang LiteSpeed Staff

    For some reason the QUERY_STRING part has been cut off from "REQUEST_URI" in our lsruby.c.
    What is the relation between "request_uri" and "ENV['REQUEST_URI']"? Same value? If yes, you can just comment out line 105 & 106 in lsruby.c
                    valLen = p - pValue;
                    *p++ = 0;
  3. joost

    joost Member

    Thanks, the values are indeed the same.

    How do I update the local gem though? Changing the source and executing the commands below does not seem to have an effect. What is the procedure to recompile and reinstall the gem?

    Went to /usr/local/lib/ruby/gems/1.8/gems/ruby-lsapi-2.4/ext/lsapi, changed the source and executed these commands:

    sudo ruby setup.rb config
    sudo ruby setup.rb setup
    sudo ruby setup.rb install
    Then restarted LiteSpeed but no change.
  4. mistwang

    mistwang LiteSpeed Staff

    ruby-lsapi 2.5 has been released, please give it a try.
    The manual installation may mess up with gem install. you may have to remove the lsapi.so created by "ruby setup.rb install".
  5. joost

    joost Member

    2.5 fixed this problem. Thanks so much!

    (Truth be told I did release a work-around by moving the query parameters into the url path)
  6. joost

    joost Member

    ruby-lsapi 2.5 seems to have a different issue, although i have been unable to investigate in depth. It seems under certain circumstances the actual question mark sign ? is included in the first query parameter name.
  7. mistwang

    mistwang LiteSpeed Staff

    My bad, 2.5 package has been updated to have it addressed.

Share This Page