package com.bloatit.framework.webserver.url;

import com.bloatit.framework.utils.Parameters;
import com.bloatit.framework.utils.SessionParameters;
import com.bloatit.framework.xcgiserver.HttpHeader;

public abstract class UrlNode implements Iterable<UrlNode>, Cloneable {

    public UrlNode() {
        super();
    }

    @Override
    public abstract UrlNode clone() throws CloneNotSupportedException;

    public final String urlString() {
        final StringBuilder sb = new StringBuilder();
        constructUrl(sb);
        return sb.toString();
    }

    public final String externalUrlString(HttpHeader header) {
        return header.getHttpHost() + urlString();
    }

    public abstract Messages getMessages();

    protected abstract void parseSessionParameters(final SessionParameters params);

    protected abstract void parseParameters(final Parameters params);

    /**
     * Begin with a '/' and no slash at the end.
     */
    protected abstract void constructUrl(final StringBuilder sb);

    @Deprecated
    public abstract void addParameter(String name, String value);
}
@@ -39,16 +39,47 @@
 r.url;%0A%0A
+import com.bloatit.common.Log;%0A
 import c
@@ -656,22 +656,410 @@
         
-return
+if (header.getServerProtocol().startsWith(%22HTTPS%22)) %7B%0A            return %22https://%22 + header.getHttpHost() + urlString();%0A        %7D%0A        if (header.getServerProtocol().startsWith(%22HTTP%22)) %7B%0A            return %22http://%22 + header.getHttpHost() + urlString();%0A        %7D%0A        Log.framework().error(%22Cannot parse the server protocol: %22 + header.getServerProtocol());%0A        return %22http://%22 +
  header.

Add the http before the externalUrlGeneration