
我們遇到一個奇怪的問題,從 SharePoint 到 Cognos TM1 URL 的直接鏈接會導致 403,但是如果我們直接刷新或貼上鏈接,它就會起作用。
原因可能與前導「http」被剝離有關(請參閱下面的其他瀏覽器),但是在原始 HTML 連結或 Fiddler 結果中並不清楚:
對原因/修復有什麼想法嗎?
從 SharePoint 選單項目:
GET http://server:9510/tm1web/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://portal/Pages/home.aspx
Accept-Language: en-AU
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: server:9510
Connection: Keep-Alive
結果 [失敗]:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Mon, 23 Feb 2015 01:25:29 GMT
在 403 之後在瀏覽器中按 F5/刷新:
GET http://server:9510/tm1web/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-AU
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: server:9510
Cookie: JSESSIONID=6A01B8265CC22BD13A9DD46575A6485F; DWRSESSIONID=gIilAwYv2K33Yahd$G7keNo4QKk
結果 [作品]:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Encoding: gzip
Content-Type: text/html;charset=UTF-8
Content-Length: 684
Date: Mon, 23 Feb 2015 01:43:40 GMT
其它瀏覽器:
- Chrome 也會收到 403 - 但不會在 URL 中顯示前導「http」 - 這表示按 F5 沒有任何影響:
- Firefox 與 Chrome 相同:
我們的解決方法是使用具有頁面的非 SharePoint Web 伺服器來執行重新導向(例如 HTML META 重新導向)。
我們認為PermissiveXFrameHeaderModule HTTP Module
可能是導致該問題的原因,但在我們的開發伺服器上停用它仍然會導致該問題。
附加範例:
從 SharePointRedirect
頁面:
GET http://portal/Pages/TM1-Redirect.aspx HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://portal/Pages/home.aspx
Accept-Language: en-AU
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: portal
Connection: Keep-Alive
Cookie: ...
結果#1 - 重定向:
HTTP/1.1 302 Found
Cache-Control: private, max-age=0
Content-Type: text/html; charset=utf-8
Expires: Sun, 08 Feb 2015 01:45:45 GMT
Last-Modified: Mon, 23 Feb 2015 01:45:45 GMT
Location: http://server:9510/tm1web/
Server: Microsoft-IIS/8.0
X-SharePointHealthScore: 0
X-AspNet-Version: 4.0.30319
SPRequestGuid: 9664ec9c-9790-10c2-3b44-67b194daa158
request-id: 9664ec9c-9790-10c2-3b44-67b194daa158
SPRequestDuration: 74
SPIisLatency: 0
WWW-Authenticate: Negotiate ...
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4561
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Mon, 23 Feb 2015 01:45:45 GMT
Content-Length: 146
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://server:9510/tm1web/">here</a>.</h2>
</body></html>
結果 #2 - [失敗- 同上]:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Mon, 23 Feb 2015 01:45:45 GMT
答案1
若要解決此問題,請修改 tm1web_config.xml 文件,如下所示:
改變這個
<add key="CrossDomainAccessList" value="" />
到
<add key="CrossDomainAccessList" value="*" />
並重新啟動應用程式伺服器服務。