function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eduardo ChiocconiEduardo Chiocconi 

NETWORK_ERR: XMLHttpRequest Exception 101 on Safari.

Hi,
    I am embedding a SmartGWT application inside a Canvas to render it into a Tab within Salesforce. I started this process and it works fine on Chrome. My next browser was Safari. On the first AJAX call from my app to the server, it is failing with the error code shown on the subject (NETWORK_ERR: XMLHttpRequest Exception 101"). For some reason this error does not happen on Chrome but it does on Safari. I also tried on Firefox and goes far beyond this point (i have another rendering issue with FF though).
    From a logical perspective, I am embedding a client application that connects to a server application both running on the same server. The AJAX call that is failing is from the client app to the server app both on a same host.
    Why is it possible this is happening? Any suggestions for troubleshooting would be appreciated.
    Thanks !
Eduardo ChiocconiEduardo Chiocconi
I have been digging deeper into this problem and found the following exception on Safari's 7 Developer Console.

[Error] Refused to set unsafe header "Host"
setRequestHeader ([native code], line 0)
com_google_gwt_xhr_client_XMLHttpRequest_$setRequestHeader__Lcom_google_gwt_xhr_client_XMLHttpRequest_2Ljava_lang_String_2Ljava_lang_String_2V (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 7011)
com_google_gwt_http_client_RequestBuilder_$setHeaders__Lcom_google_gwt_http_client_RequestBuilder_2Lcom_google_gwt_xhr_client_XMLHttpRequest_2V (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 1545)
com_google_gwt_http_client_RequestBuilder_$doSend__Lcom_google_gwt_http_client_RequestBuilder_2Ljava_lang_String_2Lcom_google_gwt_http_client_RequestCallback_2Lcom_google_gwt_http_client_Request_2 (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 1475)
com_google_gwt_http_client_RequestBuilder_$send__Lcom_google_gwt_http_client_RequestBuilder_2Lcom_google_gwt_http_client_Request_2 (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 1513)
...

And then another error:

[Error] XMLHttpRequest cannot load https://testuser@gmail.com@myhost/rest/v1/authenticate. Cross origin requests are only supported for HTTP.
send ([native code], line 0)
com_google_gwt_http_client_RequestBuilder_$doSend__Lcom_google_gwt_http_client_RequestBuilder_2Ljava_lang_String_2Lcom_google_gwt_http_client_RequestCallback_2Lcom_google_gwt_http_client_Request_2 (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 1488)
com_google_gwt_http_client_RequestBuilder_$send__Lcom_google_gwt_http_client_RequestBuilder_2Lcom_google_gwt_http_client_Request_2 (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 1513)
org_restlet_gwt_engine_http_GwtHttpClientCall_$sendRequest__Lorg_restlet_gwt_engine_http_GwtHttpClientCall_2Lorg_restlet_gwt_data_Request_2Lorg_restlet_gwt_data_Response_2Lorg_restlet_gwt_Callback_2V (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 76517)
org_restlet_gwt_engine_http_HttpClientConverter_$commit__Lorg_restlet_gwt_engine_http_HttpClientConverter_2Lorg_restlet_gwt_engine_http_HttpClientCall_2Lorg_restlet_gwt_data_Request_2Lorg_restlet_gwt_data_Response_2Lorg_restlet_gwt_Callback_2V (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 76821)
org_restlet_gwt_engine_http_HttpClientHelper_$handle__Lorg_restlet_gwt_engine_http_HttpClientHelper_2Lorg_restlet_gwt_data_Request_2Lorg_restlet_gwt_data_Response_2Lorg_restlet_gwt_Callback_2V (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 76611)
org_restlet_gwt_Uniform_$handle__Lorg_restlet_gwt_Uniform_2Lorg_restlet_gwt_data_Request_2Lorg_restlet_gwt_Callback_2V (7A854B7CC12E35B06C7D2557B5D4E636.cache.html, line 18803)
...

A couple of odd things:
1. This code runs well outside Canvas. I am inclined to think that the first error may be in direct relation to the SmartGWT application being embedded into a Canvas. The code where this is failing is
2. The second error says it cannot do a cross-origin request on HTTPS calls. Well, my site is all accessible via HTTPS only and I guess this is the recommended by Canvas. At least the first request needs to be accessible via HTTPS.

Anyone has seen something like this?