Show
Ignore:
Timestamp:
05/14/07 16:03:16 (20 months ago)
Author:
jburke
Message:

Fixes #3011.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tags/release-0.4.2/src/io/xip_server.html

    r7055 r8611  
    2020        ALL OF YOUR XHR-ENABLED SERVICES ON YOUR SITE.  
    2121         
    22         In order for this file to work, you should define a function with the following signature: 
     22        In order for this file to work, you need to uncomment the script element, 
     23        and you should define a function with the following signature: 
    2324         
    2425        function isAllowedRequest(request){ 
     
    4647        See xip_client.html for more info on the xip fragment identifier protocol.       
    4748        --> 
    48         <script type="text/javascript"> 
    49         // <!-- 
    50         djConfig = { 
    51                 parseWidgets: false, 
    52                 baseScriptUri: "./" 
    53         } 
    54         // --> 
    55         </script> 
    56         <script type="text/javascript"> 
     49         
     50        <!-- Security protection: uncomment the script tag to enable. --> 
     51        <!-- script type="text/javascript" --> 
    5752        // <!-- 
    5853                //Core XHR handling taken from Dojo IO code. 
     
    347342                xipStateId = config.id; 
    348343                xipClientUrl = config.client; 
     344                 
     345                //Make sure we don't have a javascript: url, just for good measure. 
     346                if(xipClientUrl.split(":")[0].match(/javascript/i)){ 
     347                        throw "Invalid client URL"; 
     348                } 
     349                if(!xipStateId.match(/^XhrIframeProxy[0-9]+$/)){ 
     350                        throw "Invalid state ID"; 
     351                } 
     352 
    349353                xipUseFrameRecursion = config["fr"]; 
    350354 
     
    353357                if(xipUseFrameRecursion == "true"){ 
    354358                        var serverUrl = window.location.href.split("#")[0]; 
    355                         document.getElementById("iframeHolder").innerHTML = '<iframe src="' 
    356                                 + makeClientUrl("init", 'id=' + xipStateId + '&server=' + encodeURIComponent(serverUrl) 
    357                                 + '&fr=endpoint') + '" name="' + xipStateId + '_clientEndPoint"></iframe>'; 
     359                        document.getElementById("iframeHolder").innerHTML = '<iframe name="' 
     360                                + xipStateId + '_clientEndPoint' 
     361                                + '" src="javascript:false">' 
     362                                + '</iframe>'; 
     363                        var iframeNode = document.getElementsByTagName("iframe")[0]; 
     364                        iframeNode.src = makeClientUrl("init", 'id=' + xipStateId + '&server=' 
     365                                + encodeURIComponent(serverUrl) + '&fr=endpoint'); 
    358366                }else{ 
    359367                        setClientUrl("loaded");