final public void rewriteURL(String newURL)
{
 this.URL=newURL;
 if(!hasHost && referer_hack<2) return; // scan and kill old host header
 String s,s1;
 int cachedsize=headers.size();

 for(int i=0;i<cachedsize;i++)
 {
    int j;
    s=headers.get(i);
    j=s.indexOf(':',0);
    if(j==-1) continue;
    s1=s.substring(0,j).toLowerCase();
    // s2=s.substring(j+1).trim();
    if(s1.equals("host")) {
                            headers.remove(i--);
                            cachedsize--;
                            continue;
                           }
    if(referer_hack>0 && s1.equals("referer")) {
                                            s="Referer: "+newURL;
                                            headers.set(i,s);
                                            continue;
    }
 }
 hasHost=false;
}