From: <bra...@us...> - 2008-11-07 22:31:45
|
Revision: 2636 http://archive-access.svn.sourceforge.net/archive-access/?rev=2636&view=rev Author: bradtofel Date: 2008-11-07 22:31:42 +0000 (Fri, 07 Nov 2008) Log Message: ----------- FEATURE: added exactSchemeMatch configuration, which for now is set on all requests within this AccessPoint. TWEAK: removed some code that had been commented out and is no longer used/needed. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2008-11-07 22:29:45 UTC (rev 2635) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2008-11-07 22:31:42 UTC (rev 2636) @@ -80,6 +80,7 @@ private boolean useServerName = false; private boolean useAnchorWindow = false; + private boolean exactSchemeMatch = true; private int contextPort = 0; private String contextName = null; @@ -217,11 +218,6 @@ prefix.append(":").append(waybackPort); } String contextPath = getContextPath(httpRequest); -// if(contextPath.length() > 1) { -// prefix.append(contextPath); -// } else { -// prefix.append(contextPath); -// } prefix.append(contextPath); return prefix.toString(); } @@ -264,19 +260,6 @@ } catch(IOException e) { // TODO: figure out if we got IO because of a missing dispatcher } -// uiResults.storeInRequest(httpRequest,translated); -// RequestDispatcher dispatcher = null; -// // special case for the front '/' page: -// if(translated.length() == 0) { -// translated = "/"; -// } else { -// translated = "/" + translated; -// } -// dispatcher = httpRequest.getRequestDispatcher(translated); -// if(dispatcher != null) { -// dispatcher.forward(httpRequest, httpResponse); -// return true; -// } return false; } @@ -299,9 +282,13 @@ if(wbRequest != null) { handled = true; + + // TODO: refactor this code into RequestParser implementations wbRequest.setAccessPoint(this); wbRequest.setContextPrefix(getAbsoluteLocalPrefix(httpRequest)); wbRequest.fixup(httpRequest); + // end of refactor + if(authentication != null) { if(!authentication.isTrue(wbRequest)) { throw new AuthenticationControlException("Not authorized"); @@ -311,6 +298,12 @@ if(exclusionFactory != null) { wbRequest.setExclusionFilter(exclusionFactory.get()); } + // TODO: refactor this into RequestParser implementations, so a + // user could alter requests to change the behavior within a + // single AccessPoint. For now, this is a simple way to expose + // the feature to configuration. + wbRequest.setExactScheme(exactSchemeMatch); + if(wbRequest.isReplayRequest()) { handleReplay(wbRequest,httpRequest,httpResponse); @@ -488,7 +481,21 @@ public void setUseAnchorWindow(boolean useAnchorWindow) { this.useAnchorWindow = useAnchorWindow; } + + /** + * @return the exactSchemeMatch + */ + public boolean isExactSchemeMatch() { + return exactSchemeMatch; + } + /** + * @param exactSchemeMatch the exactSchemeMatch to set + */ + public void setExactSchemeMatch(boolean exactSchemeMatch) { + this.exactSchemeMatch = exactSchemeMatch; + } + public ExclusionFilterFactory getExclusionFactory() { return exclusionFactory; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |