Why has Ajax.Updater missed https to http?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anaconda1977
    New Member
    • Apr 2010
    • 8

    Why has Ajax.Updater missed https to http?

    From client side, I access with https. In my code

    Code:
    alert(location.protocol)   // pop up https
    
    new Ajax.Updater("sip_tab_content",
                        "/rails/test_modules/show/" + $F("boardid"),                    
                        {method :'get',
                          onFailure:displaySIPTabFailure,
                          onComplete:displaySIPTabFailure
                        });


    On server side, is ruby on rails:

    Code:
    def show
        @test_module = TestModule.find(params[:id])
    File.open("C:\\rubylog.txt", 'w') {|f| f.write(request.url)}    # I get http://.......  here
        respond_to do |format|
          format.html # show.html.erb
          format.xml  { render :xml => @test_module }
        end
      end
    I don't know whether Ajax.Updater missed my https. I found articles saying: Ajax.Updater is from Ajax.Request and the latter is from XMLHttpRequest, and XMLHttpRequest can transmit on both http and https. Then where is the problem??

    Anyone know?

    thanks.
    Last edited by Dormilich; May 9 '10, 06:43 PM. Reason: Please use [code] tags when posting code
  • anaconda1977
    New Member
    • Apr 2010
    • 8

    #2
    I'm not sure whether RoR can handle https request properly by default.

    Comment

    • anaconda1977
      New Member
      • Apr 2010
      • 8

      #3
      Also I wrote: f.write(request .port), the value is 80. However, the show page seemed to be displayed with https, for I had banned http and enforce https access on server and the show page under view folder is displayed without error. So I suspect that the request only takes default values for some parameters, as the client is Javascript file, not ruby set the request.url, request.ssl, request.port or others of such. I only guess and not sure of this. If the request is not reliable, I didn't how to judge the request is using http or https from the ruby code, not by my eyes.

      Comment

      • anaconda1977
        New Member
        • Apr 2010
        • 8

        #4
        The second code is in RoR, using MVC mode, in class derived from ApplicationCont roller. Acting as server.
        the first is JS file. Acting as client to send request..

        Comment

        Working...