01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rproxy.rewriter;
06:
07: import com.sun.portal.rewriter.util.uri.PageSpec;
08: import com.sun.portal.rproxy.rewriter.util.SRAPConfigManager;
09: import com.sun.portal.rproxy.rewriter.util.http.ContentInfo;
10:
11: final class SRAPAdapterHelper {
12: static void updateMIME(PageSpec aPageSpec, ContentInfo aContentInfo) {
13: // As per the RFC2616 (Section 7.2.1), in case server does not send
14: // the MIME as part of content heddar, Browser can fall back to deciding
15: // on how to render it based on extention or by looking at the content
16:
17: // BugNo: 4766421 - WebLogic and Oracle Seervers does not send the MIME
18: // BugNo: 4798308
19: // Bug No:4708870 - If iplanet server by default is not configured for
20: // CAB File MIME, don't treat it as HTML
21:
22: // Intelligent guess of MIME allowed then check if the MIME is unknown
23: if (aContentInfo.isInvalidMIME()
24: && SRAPConfigManager.isMIMEGuessingEnabled()) {
25: String lGuessedMIME = SRAPConfigManager
26: .selectParser4URI(aPageSpec);
27: if (lGuessedMIME != null) {
28: aContentInfo.setMIME(lGuessedMIME);
29: }
30: }
31:
32: if (aContentInfo.isInvalidMIME()) {
33: aContentInfo.setMIME(aPageSpec.getMIME());
34: }
35: }// updateMIME()
36:
37: }// class SRAPAdapterHelper
|