anchor.diff:  %><%@ page import="org.archive.wayback.core.WaybackRequest"
   %><%@ page import="org.archive.wayback.core.CaptureSearchResult"
   %><%@ page import="org.archive.wayback.util.StringFormatter"
  +%><%@ page import="org.archive.wayback.util.url.UrlOperations"
   %><%
   UIResults results = UIResults.extractReplay(request);
   
  
positive.code: <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"
  %><%@ page import="java.util.Date"
  %><%@ page import="java.lang.StringBuffer"
  %><%@ page import="org.archive.wayback.archivalurl.ArchivalUrlDateRedirectReplayRenderer"
  %><%@ page import="org.archive.wayback.ResultURIConverter"
  
negative.code: String targetUrl = cResult.getRedirectUrl();
  String captureTS = cResult.getCaptureTimestamp();
  Date captureDate = cResult.getCaptureDate();
  if(targetUrl.equals("-")) {
  	Map<String,String> headers = results.getResource().getHttpHeaders();
  	Iterator<String> headerNameItr = headers.keySet().iterator();
  	while(headerNameItr.hasNext()) {
  	       String name = headerNameItr.next();
  	       if(name.toUpperCase().equals("LOCATION")) {
  	    	    targetUrl = headers.get(name);
  	            // by the spec, these should be absolute already, but just in case:
  	            targetUrl = UrlOperations.resolveUrl(sourceUrl, targetUrl);
  	    	    
  	    	    
  	       }
  	}
  }
  // TODO: Handle replay if we still don't have a redirect..
  String dateSpec = 
  	ArchivalUrlDateRedirectReplayRenderer.makeFlagDateSpec(captureTS, wbr);
  
  