Changeset 2404 for lang/ruby/ssb/trunk

Show
Ignore:
Timestamp:
12/04/07 14:44:15 (6 years ago)
Author:
coji
Message:

lang/ruby/ssb: use uri param key ssb_q instead of ssb

Location:
lang/ruby/ssb/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ssb/trunk/libs/ssb.rb

    r2294 r2404  
    190190              %Q! #{tag}="#{$2}"#{$3} target="_top" >! 
    191191            elsif $2.index('/') == 0 
    192               %Q! #{tag}="./#{ssb}?q=#{CGI.escape(('http://' + request_uri.host + ':' + request_uri.port.to_s + $2).to_s)}"#{$3} target="_top" >! 
     192              %Q! #{tag}="./#{ssb}?ssb_q=#{CGI.escape(('http://' + request_uri.host + ':' + request_uri.port.to_s + $2).to_s)}"#{$3} target="_top" >! 
    193193            else 
    194               %Q! #{tag}="./#{ssb}?q=#{CGI.escape((request_uri + $2).to_s)}"#{$3} target="_top" >! 
     194              %Q! #{tag}="./#{ssb}?ssb_q=#{CGI.escape((request_uri + $2).to_s)}"#{$3} target="_top" >! 
    195195            end 
    196196          when 'action' 
    197             %Q! #{tag}="./" #{$3}><input type="hidden" name="q" value="#{(request_uri + $2).to_s}" />! 
     197            %Q! #{tag}="./" #{$3}><input type="hidden" name="ssb_q" value="#{(request_uri + $2).to_s}" />! 
    198198          end 
    199199        rescue => err 
  • lang/ruby/ssb/trunk/libs/ssb/request.rb

    r2397 r2404  
    8282      in_query.each do |key,value| 
    8383        value = value.to_s unless value.instance_of?(String) 
    84         if key == 'q'           # request URI 
     84        if key == 'ssb_q'           # request URI 
    8585          uri_base = value.dup.untaint 
    8686        else                    # passing parameters 
  • lang/ruby/ssb/trunk/ssb-webrick.rb

    r2183 r2404  
    2727if cgi_mode 
    2828  srv.mount('/', WEBrick::HTTPServlet::CGIHandler, File.join(docroot, 'index.rbx')) 
    29   srv.mount('/ktai_db.rbx', WEBrick::HTTPServlet::CGIHandler, File.join(docroot, 'ktai_db.rbx')) 
    3029else 
    3130  srv.mount_proc('/') {|req, res| 
  • lang/ruby/ssb/trunk/templates/ssb.rhtml

    r2343 r2404  
    77  <script type="text/javascript" src="javascripts/qrcode.js"></script> 
    88  <script type="text/javascript" src="javascripts/ktai_db.js"></script> 
    9 <script type="text/javascript" src="javascripts/suggest.js"></script> 
     9  <script type="text/javascript" src="javascripts/suggest.js"></script> 
    1010  <script type="text/javascript" src="javascripts/ssb.js"></script> 
    1111  <link rel="stylesheet" href="stylesheets/ssb.css" type="text/css" media="screen" /> 
     
    1919    <form action="./" id="location" method="get" name="location"> 
    2020      ssb 
    21       <input id="uri_input" name="q" size="60" value="<%= request_uri %>" type="text" /> 
     21      <input id="uri_input" name="ssb_q" size="60" value="<%= request_uri %>" type="text" /> 
    2222      <input id="move_button" value="移動" type="submit" /> 
    2323    </form> 
  • lang/ruby/ssb/trunk/test/filter_test.rb

    r2295 r2404  
    2121    assert_equal( 
    2222        SSB::Application.filter_html("<a href='/bar'>foo</a>", URI.parse('http://example.com/foo'), Term.new(SSB::KtaiSpec::CARRIER_DOCOMO), '', ''), 
    23         %Q{<a href=\"./?q=http%3A%2F%2Fexample.com%3A80%2Fbar\" target=\"_top\" >foo</a>} 
     23        %Q{<a href=\"./?ssb_q=http%3A%2F%2Fexample.com%3A80%2Fbar\" target=\"_top\" >foo</a>} 
    2424    ) 
    2525  end 
  • lang/ruby/ssb/trunk/test/request_test.rb

    r2397 r2404  
    88  def request_params 
    99    { 
    10       'q'.taint  => MockServer.uri.dup.taint, 
     10      'ssb_q'.taint  => MockServer.uri.dup.taint, 
    1111      'p1'.taint => 'foo'.taint, 
    1212      'p2'.taint => 'bar'.taint, 
  • lang/ruby/ssb/trunk/test/ssb_test.rb

    r2252 r2404  
    4949 
    5050  test 'ssb get local' do 
    51     ret = kick_ssb('GET', "q=#{MockServer.uri}&uid=NULLGWDOCOMO") 
     51    ret = kick_ssb('GET', "ssb_q=#{MockServer.uri}&uid=NULLGWDOCOMO") 
    5252    assert_match(/It works by GET/, ret) 
    5353  end 
     
    5555  test 'ssb get invalidhost' do 
    5656    # noname is invalid hostname 
    57     ret = kick_ssb('GET', 'q=noname') 
     57    ret = kick_ssb('GET', 'ssb_q=noname') 
    5858    exp = Regexp.union( 
    5959      /getaddrinfo: Name or service not known/, 
     
    6363 
    6464  test 'ssb post local' do 
    65     ret = kick_ssb('POST', '', "q=#{MockServer.uri}?param=test&uid=NULLGWDOCOMO") 
     65    ret = kick_ssb('POST', '', "ssb_q=#{MockServer.uri}?param=test&uid=NULLGWDOCOMO") 
    6666    assert_match(/It works by POST/, ret) 
    6767  end 
     
    6969  test 'ssb post invalidhost' do 
    7070    # noname is invalid hostname 
    71     ret = kick_ssb('POST', '', 'q=noname&param=test&uid=NULLGWDOCOMO') 
     71    ret = kick_ssb('POST', '', 'ssb_q=noname&param=test&uid=NULLGWDOCOMO') 
    7272    assert_match(/getaddrinfo: (?:nodename nor servname provided|Name or service not known)/, ret) 
    7373  end