/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.http.CookieUtils
 *  com.l7tech.common.http.GenericHttpHeader
 *  com.l7tech.common.http.GenericHttpRequestParams
 *  com.l7tech.common.http.HttpConstants
 *  com.l7tech.common.http.HttpCookie
 *  com.l7tech.common.http.HttpCookie$IllegalFormatException
 *  com.l7tech.common.http.HttpHeader
 *  com.l7tech.gateway.common.audit.AssertionMessages
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.message.HeadersKnob
 *  com.l7tech.message.HttpInboundResponseKnob
 *  com.l7tech.message.HttpRequestKnob
 *  com.l7tech.message.HttpServletRequestKnob
 *  com.l7tech.message.Message
 *  com.l7tech.policy.assertion.HttpPassthroughRule
 *  com.l7tech.policy.assertion.HttpPassthroughRuleSet
 *  org.apache.commons.lang3.StringUtils
 *  org.jetbrains.annotations.Nullable
 */
package com.l7tech.server.util;

import com.l7tech.common.http.CookieUtils;
import com.l7tech.common.http.GenericHttpHeader;
import com.l7tech.common.http.GenericHttpRequestParams;
import com.l7tech.common.http.HttpConstants;
import com.l7tech.common.http.HttpCookie;
import com.l7tech.common.http.HttpHeader;
import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.message.HeadersKnob;
import com.l7tech.message.HttpInboundResponseKnob;
import com.l7tech.message.HttpRequestKnob;
import com.l7tech.message.HttpServletRequestKnob;
import com.l7tech.message.Message;
import com.l7tech.policy.assertion.HttpPassthroughRule;
import com.l7tech.policy.assertion.HttpPassthroughRuleSet;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.variable.ExpandVariables;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;

public class HttpForwardingRuleEnforcer {
    private static final Logger a;
    private static final String[] b;

    /*
     * WARNING - void declaration
     */
    public static void handleRequestHeaders(Message message, GenericHttpRequestParams genericHttpRequestParams, PolicyEnforcementContext policyEnforcementContext, HttpPassthroughRuleSet httpPassthroughRuleSet, Audit audit, @Nullable Map<String, ?> map, @Nullable String[] stringArray) throws IOException {
        try {
            if (httpPassthroughRuleSet.ruleForName(HttpConstants.HEADER_USER_AGENT) != 3) {
                HttpForwardingRuleEnforcer.a(HttpConstants.HEADER_USER_AGENT, genericHttpRequestParams);
            }
        }
        catch (IOException iOException) {
            throw HttpForwardingRuleEnforcer.a(iOException);
        }
        GenericHttpRequestParams genericHttpRequestParams2 = new GenericHttpRequestParams(genericHttpRequestParams);
        genericHttpRequestParams2.setExtraHeaders(new HttpHeader[0]);
        ArrayList<String> arrayList = new ArrayList<String>();
        if (!httpPassthroughRuleSet.isForwardAll()) {
            var9_9 = new HashSet();
            for (int i2 = 0; i2 < httpPassthroughRuleSet.getRules().length; ++i2) {
                String string;
                block35: {
                    HttpPassthroughRule httpPassthroughRule = httpPassthroughRuleSet.getRules()[i2];
                    string = httpPassthroughRule.getName();
                    try {
                        if (string.isEmpty()) {
                            throw new IOException(b[3]);
                        }
                    }
                    catch (IOException iOException) {
                        throw HttpForwardingRuleEnforcer.a(iOException);
                    }
                    if (httpPassthroughRule.isUsesCustomizedValue()) {
                        boolean bl2;
                        String[] stringArray2;
                        String string2;
                        void var13_20;
                        block36: {
                            block34: {
                                block32: {
                                    String string3;
                                    block33: {
                                        string3 = httpPassthroughRule.getCustomizeValue();
                                        try {
                                            try {
                                                if (stringArray == null || stringArray.length <= 0) break block32;
                                            }
                                            catch (IOException iOException) {
                                                throw HttpForwardingRuleEnforcer.a(iOException);
                                            }
                                            if (map != null) break block33;
                                        }
                                        catch (IOException iOException) {
                                            throw HttpForwardingRuleEnforcer.a(iOException);
                                        }
                                        map = policyEnforcementContext.getVariableMap(stringArray, audit);
                                    }
                                    String string4 = ExpandVariables.process(string3, map, audit);
                                }
                                try {
                                    if (!string.equalsIgnoreCase(HttpConstants.HEADER_HOST)) break block34;
                                    genericHttpRequestParams.setVirtualHost((String)var13_20);
                                    genericHttpRequestParams2.removeExtraHeader(HttpConstants.HEADER_HOST);
                                    a.fine(b[12] + (String)var13_20);
                                    break block35;
                                }
                                catch (IOException iOException) {
                                    throw HttpForwardingRuleEnforcer.a(iOException);
                                }
                            }
                            try {
                                if (!string.equalsIgnoreCase(HttpConstants.HEADER_COOKIE)) break block36;
                                arrayList.addAll(CookieUtils.splitCookieHeader((String)var13_20));
                                break block35;
                            }
                            catch (IOException iOException) {
                                throw HttpForwardingRuleEnforcer.a(iOException);
                            }
                        }
                        try {
                            string2 = string;
                            String[] stringArray3 = new String[1];
                            stringArray2 = stringArray3;
                            stringArray3[0] = var13_20;
                            bl2 = !var9_9.contains(string.toLowerCase());
                        }
                        catch (IOException iOException) {
                            throw HttpForwardingRuleEnforcer.a(iOException);
                        }
                        HttpForwardingRuleEnforcer.a(string2, stringArray2, bl2, genericHttpRequestParams2);
                    } else {
                        var18_28 = b;
                        String[] stringArray4 = message.getHeadersKnob().getHeaderValues(string, var18_28[7], false);
                        if (string.equalsIgnoreCase(HttpConstants.HEADER_COOKIE)) {
                            for (String string5 : stringArray4) {
                                arrayList.addAll(CookieUtils.splitCookieHeader((String)string5));
                            }
                        } else {
                            boolean bl3;
                            String[] stringArray5;
                            String string6;
                            try {
                                string6 = string;
                                stringArray5 = stringArray4;
                                bl3 = !var9_9.contains(string.toLowerCase());
                            }
                            catch (IOException iOException) {
                                throw HttpForwardingRuleEnforcer.a(iOException);
                            }
                            HttpForwardingRuleEnforcer.a(string6, stringArray5, bl3, genericHttpRequestParams2);
                        }
                    }
                }
                var9_9.add(string.toLowerCase());
            }
        } else {
            var9_9 = new HashSet();
            var18_28 = b;
            for (String string : message.getHeadersKnob().getHeaderNames(var18_28[7], false, false)) {
                boolean bl4;
                String[] stringArray6;
                String string7;
                block38: {
                    block37: {
                        try {
                            try {
                                if (string.equalsIgnoreCase(HttpConstants.HEADER_COOKIE)) continue;
                                string7 = string;
                                stringArray6 = message.getHeadersKnob().getHeaderValues(string, b[7], false);
                                if (var9_9.contains(string)) break block37;
                            }
                            catch (IOException iOException) {
                                throw HttpForwardingRuleEnforcer.a(iOException);
                            }
                            bl4 = true;
                            break block38;
                        }
                        catch (IOException iOException) {
                            throw HttpForwardingRuleEnforcer.a(iOException);
                        }
                    }
                    bl4 = false;
                }
                HttpForwardingRuleEnforcer.a(string7, stringArray6, bl4, genericHttpRequestParams2);
                var9_9.add(string);
            }
            arrayList.addAll(message.getHttpCookiesKnob().getCookiesAsHeaders());
        }
        HttpForwardingRuleEnforcer.a(genericHttpRequestParams2, arrayList, audit);
        for (HttpHeader httpHeader : genericHttpRequestParams2.getExtraHeaders()) {
            genericHttpRequestParams.addExtraHeader(httpHeader);
        }
    }

    private static void a(String string, GenericHttpRequestParams genericHttpRequestParams) {
        List list = genericHttpRequestParams.getExtraHeaders();
        Iterator iterator = list.iterator();
        while (iterator.hasNext()) {
            GenericHttpHeader genericHttpHeader = (GenericHttpHeader)iterator.next();
            if (string.compareToIgnoreCase(genericHttpHeader.getName()) != 0) continue;
            String[] stringArray = b;
            a.finest(stringArray[0] + string + stringArray[6] + genericHttpHeader.getFullValue());
            iterator.remove();
        }
    }

    public static List<Param> handleRequestParameters(PolicyEnforcementContext policyEnforcementContext, Message message, HttpPassthroughRuleSet httpPassthroughRuleSet, Audit audit, @Nullable Map<String, ?> map, @Nullable String[] stringArray) throws IOException {
        HttpServletRequestKnob httpServletRequestKnob = (HttpServletRequestKnob)message.getKnob(HttpServletRequestKnob.class);
        try {
            if (httpServletRequestKnob == null) {
                a.log(Level.FINE, b[15]);
                return null;
            }
        }
        catch (IOException iOException) {
            throw HttpForwardingRuleEnforcer.a(iOException);
        }
        try {
            if (!HttpForwardingRuleEnforcer.a((HttpRequestKnob)httpServletRequestKnob)) {
                a.log(Level.FINE, b[8]);
                return null;
            }
        }
        catch (IOException iOException) {
            throw HttpForwardingRuleEnforcer.a(iOException);
        }
        ArrayList<Param> arrayList = new ArrayList<Param>();
        Map map2 = httpServletRequestKnob.getRequestBodyParameterMap();
        if (httpPassthroughRuleSet.isForwardAll()) {
            for (Map.Entry entry : map2.entrySet()) {
                String[] stringArray2;
                String string = (String)entry.getKey();
                for (String string2 : stringArray2 = (String[])entry.getValue()) {
                    arrayList.add(new Param(string, string2));
                }
            }
        } else {
            for (int i2 = 0; i2 < httpPassthroughRuleSet.getRules().length; ++i2) {
                Object object;
                HttpPassthroughRule httpPassthroughRule = httpPassthroughRuleSet.getRules()[i2];
                String string = httpPassthroughRule.getName();
                if (httpPassthroughRule.isUsesCustomizedValue()) {
                    block19: {
                        block20: {
                            object = httpPassthroughRule.getCustomizeValue();
                            try {
                                try {
                                    if (stringArray == null || stringArray.length <= 0) break block19;
                                }
                                catch (IOException iOException) {
                                    throw HttpForwardingRuleEnforcer.a(iOException);
                                }
                                if (map != null) break block20;
                            }
                            catch (IOException iOException) {
                                throw HttpForwardingRuleEnforcer.a(iOException);
                            }
                            map = policyEnforcementContext.getVariableMap(stringArray, audit);
                        }
                        object = ExpandVariables.process((String)object, map, audit);
                    }
                    arrayList.add(new Param(string, (String)object));
                    continue;
                }
                object = (String[])map2.get(string);
                try {
                    if (object == null || ((String[])object).length <= 0) continue;
                }
                catch (IOException iOException) {
                    throw HttpForwardingRuleEnforcer.a(iOException);
                }
                for (String string3 : object) {
                    arrayList.add(new Param(string, string3));
                }
            }
        }
        return arrayList;
    }

    public static void handleResponseHeaders(HttpInboundResponseKnob httpInboundResponseKnob, Message message, Audit audit, HttpPassthroughRuleSet httpPassthroughRuleSet, PolicyEnforcementContext policyEnforcementContext, GenericHttpRequestParams genericHttpRequestParams, @Nullable Map<String, ?> map, @Nullable String[] stringArray) {
        if (message != null && message.getHeadersKnob() != null) {
            HeadersKnob headersKnob = message.getHeadersKnob();
            URL uRL = genericHttpRequestParams.getTargetUrl();
            if (httpPassthroughRuleSet.isForwardAll()) {
                boolean bl2 = a.isLoggable(Level.FINE);
                for (HttpHeader httpHeader : httpInboundResponseKnob.getHeadersArray()) {
                    String[] stringArray2;
                    boolean bl3;
                    if (HttpConstants.HEADER_SET_COOKIE.equalsIgnoreCase(httpHeader.getName())) {
                        String string = httpHeader.getFullValue();
                        HttpForwardingRuleEnforcer.a(policyEnforcementContext, headersKnob, uRL, string);
                        continue;
                    }
                    boolean bl4 = bl3 = !HttpForwardingRuleEnforcer.a(httpHeader.getName());
                    if (!bl3 && bl2) {
                        stringArray2 = b;
                        a.fine(stringArray2[2] + httpHeader.getName() + stringArray2[16] + httpHeader.getFullValue());
                    }
                    stringArray2 = b;
                    headersKnob.addHeader(httpHeader.getName(), (Object)httpHeader.getFullValue(), stringArray2[7], bl3);
                }
            } else {
                for (HttpPassthroughRule httpPassthroughRule : httpPassthroughRuleSet.getRules()) {
                    String[] stringArray3;
                    Object object;
                    if (httpPassthroughRule.isUsesCustomizedValue()) {
                        object = httpPassthroughRule.getCustomizeValue();
                        if (stringArray != null && stringArray.length > 0) {
                            if (map == null) {
                                map = policyEnforcementContext.getVariableMap(stringArray, audit);
                            }
                            object = ExpandVariables.process((String)object, map, audit);
                        }
                        stringArray3 = b;
                        headersKnob.addHeader(httpPassthroughRule.getName(), object, stringArray3[7]);
                        continue;
                    }
                    object = httpInboundResponseKnob.getHeaderValues(httpPassthroughRule.getName());
                    if (object != null && ((String[])object).length > 0) {
                        for (String string : object) {
                            if (HttpConstants.HEADER_SET_COOKIE.equalsIgnoreCase(httpPassthroughRule.getName())) {
                                HttpForwardingRuleEnforcer.a(policyEnforcementContext, headersKnob, uRL, string);
                                continue;
                            }
                            stringArray3 = b;
                            headersKnob.addHeader(httpPassthroughRule.getName(), (Object)string, stringArray3[7]);
                        }
                        continue;
                    }
                    stringArray3 = b;
                    a.fine(stringArray3[1] + httpPassthroughRule.getName() + stringArray3[9]);
                }
            }
        } else {
            a.log(Level.WARNING, b[11]);
        }
    }

    private static void a(PolicyEnforcementContext policyEnforcementContext, HeadersKnob headersKnob, URL uRL, String string) {
        StringBuffer stringBuffer = new StringBuffer();
        String string2 = policyEnforcementContext.isOverwriteResponseCookieDomain() ? CookieUtils.DOMAIN + "=" + uRL.getHost() : null;
        String string3 = policyEnforcementContext.isOverwriteResponseCookiePath() ? CookieUtils.PATH + "=" + uRL.getPath() : null;
        List list = CookieUtils.splitCookieHeader((String)string);
        for (int i2 = 0; i2 < list.size(); ++i2) {
            if (i2 > 0) {
                stringBuffer.append(CookieUtils.ATTRIBUTE_DELIMITER);
            }
            stringBuffer.append(CookieUtils.addCookieDomainAndPath((String)((String)list.get(i2)), (String)string2, (String)string3));
        }
        String string4 = stringBuffer.toString();
        headersKnob.addHeader(HttpConstants.HEADER_SET_COOKIE, (Object)string4, b[10]);
    }

    private static boolean a(HttpRequestKnob httpRequestKnob) {
        String[] stringArray = b;
        String[] stringArray2 = httpRequestKnob.getHeaderValues(stringArray[5]);
        if (stringArray2 != null) {
            for (String string : stringArray2) {
                if (!string.toLowerCase().contains(b[13])) continue;
                return true;
            }
        }
        return false;
    }

    private static boolean a(String string) {
        return HttpPassthroughRuleSet.HEADERS_NOT_TO_IMPLICITLY_FORWARD.contains(string.toLowerCase());
    }

    private static Collection<String> a(Collection<String> collection, Audit audit) {
        ArrayList<String> arrayList = new ArrayList<String>();
        for (String string : collection) {
            try {
                HttpCookie httpCookie = new HttpCookie(string);
                if (!CookieUtils.isPassThroughCookie((HttpCookie)httpCookie)) continue;
                audit.logAndAudit((AuditDetailMessage)AssertionMessages.HTTPROUTE_ADDCOOKIE_VERSION, new String[]{httpCookie.getCookieName(), String.valueOf(httpCookie.getVersion())});
                String string2 = CookieUtils.getNameAndValue((String)string);
                try {
                    if (string2 != null) {
                        arrayList.add(string2);
                        continue;
                    }
                }
                catch (HttpCookie.IllegalFormatException illegalFormatException) {
                    throw HttpForwardingRuleEnforcer.a((Exception)((Object)illegalFormatException));
                }
                arrayList.add(string);
            }
            catch (HttpCookie.IllegalFormatException illegalFormatException) {
                arrayList.add(string);
            }
        }
        return arrayList;
    }

    private static void a(String string, String[] stringArray, boolean bl2, GenericHttpRequestParams genericHttpRequestParams) throws IOException {
        block13: {
            block12: {
                try {
                    if (StringUtils.isBlank((CharSequence)string)) {
                        throw new IOException(b[14]);
                    }
                }
                catch (IOException iOException) {
                    throw HttpForwardingRuleEnforcer.a(iOException);
                }
                try {
                    try {
                        if (!string.equalsIgnoreCase(HttpConstants.HEADER_AUTHORIZATION) || genericHttpRequestParams.getPasswordAuthentication() == null) break block12;
                    }
                    catch (IOException iOException) {
                        throw HttpForwardingRuleEnforcer.a(iOException);
                    }
                    a.fine(b[4]);
                    break block13;
                }
                catch (IOException iOException) {
                    throw HttpForwardingRuleEnforcer.a(iOException);
                }
            }
            for (int i2 = 0; i2 < stringArray.length; ++i2) {
                String string2;
                block14: {
                    string2 = stringArray[i2];
                    try {
                        try {
                            if (!bl2 || i2 != 0) break block14;
                        }
                        catch (IOException iOException) {
                            throw HttpForwardingRuleEnforcer.a(iOException);
                        }
                        genericHttpRequestParams.replaceExtraHeader((HttpHeader)new GenericHttpHeader(string, string2));
                        continue;
                    }
                    catch (IOException iOException) {
                        throw HttpForwardingRuleEnforcer.a(iOException);
                    }
                }
                genericHttpRequestParams.addExtraHeader((HttpHeader)new GenericHttpHeader(string, string2));
            }
        }
    }

    private static void a(GenericHttpRequestParams genericHttpRequestParams, Collection<String> collection, Audit audit) {
        Collection<String> collection2 = HttpForwardingRuleEnforcer.a(collection, audit);
        if (!collection2.isEmpty()) {
            String string = StringUtils.join(collection2, (String)b[17]);
            genericHttpRequestParams.addExtraHeader((HttpHeader)new GenericHttpHeader(HttpConstants.HEADER_COOKIE, string));
        }
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[18];
                var3_1 = 0;
                var2_2 = "%<`je~p0y-#1hwv7w$yl%pbm#6`%abr2ykja7x8+zdasw9>-mvvz2+-\u001e\u0016=il}p>96c(cvm$\rew|by?ye`rs{%y>\u001f-yuCvm$-ew|by?\u000bxiv7}87ydzymw8c%[CJ\u0007ye`rs{%yzlg\u007f>67-`~gj.ycd~r_96y%cvm$0cb3cv%6xb{7\u007f\"-eja~d6-dj}7v28i`a7|2:lp`r>4+havyj>8av3vl2y~uvtw10ha3qq%yodp|327i%aro\"<~q\f46cqvyjz-tuv\u0012w,~`a7\u007f0<cq3a\u007f;,h%\u000b\u001f\rYU3_{6=hwH#1dv3e{&,hvg7w$ycjg7\u007fw?bw~7n8*y%`x>#1h%cvl64hqve>%,a``7\u007f%<-gv~p0ydb}xl2=4w.dq{7w9:bhzyyw/lifr>5,y%g\u007fw$ye`rs{%ydv3yq#y}wvd{9-#\u000b\u001f\rYU3_{6=hw@\u00027lg\u007fr>#6-c|ei6+i%arm'6cvv7v28i`ad>5<ndfd{w1hdwrl$yfk|u>>*-kf{ry\u001b!0\u007fqfvrz1bvg7q!<\u007fwzs{w*hq)7\u000416\u007fh%\u00127njfyj2+ha3\u007f{6=hw3`w#1-d}7{:)y|3y\u007f:<>96-ure\u007f:<y`a7j8ykja`\u007f%=-frbm2yymv7w9:bhzyyw+htfrm#ydv3yq#yeqgg";
                var4_3 = "%<`je~p0y-#1hwv7w$yl%pbm#6`%abr2ykja7x8+zdasw9>-mvvz2+-\u001e\u0016=il}p>96c(cvm$\rew|by?ye`rs{%y>\u001f-yuCvm$-ew|by?\u000bxiv7}87ydzymw8c%[CJ\u0007ye`rs{%yzlg\u007f>67-`~gj.ycd~r_96y%cvm$0cb3cv%6xb{7\u007f\"-eja~d6-dj}7v28i`a7|2:lp`r>4+havyj>8av3vl2y~uvtw10ha3qq%yodp|327i%aro\"<~q\f46cqvyjz-tuv\u0012w,~`a7\u007f0<cq3a\u007f;,h%\u000b\u001f\rYU3_{6=hwH#1dv3e{&,hvg7w$ycjg7\u007fw?bw~7n8*y%`x>#1h%cvl64hqve>%,a``7\u007f%<-gv~p0ydb}xl2=4w.dq{7w9:bhzyyw/lifr>5,y%g\u007fw$ye`rs{%ydv3yq#y}wvd{9-#\u000b\u001f\rYU3_{6=hw@\u00027lg\u007fr>#6-c|ei6+i%arm'6cvv7v28i`ad>5<ndfd{w1hdwrl$yfk|u>>*-kf{ry\u001b!0\u007fqfvrz1bvg7q!<\u007fwzs{w*hq)7\u000416\u007fh%\u00127njfyj2+ha3\u007f{6=hw3`w#1-d}7{:)y|3y\u007f:<>96-ure\u007f:<y`a7j8ykja`\u007f%=-frbm2yymv7w9:bhzyyw+htfrm#ydv3yq#yeqgg".length();
                var1_4 = 9;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 55;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = HttpForwardingRuleEnforcer.a(v0, HttpForwardingRuleEnforcer.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "b;qdn\"}# mu&\u0002yl";
                    var4_3 = "b;qdn\"}# mu&\u0002yl".length();
                    var1_4 = 12;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 34;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = HttpForwardingRuleEnforcer.a(v0, HttpForwardingRuleEnforcer.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        HttpForwardingRuleEnforcer.b = var5;
        HttpForwardingRuleEnforcer.a = Logger.getLogger(HttpForwardingRuleEnforcer.class.getName());
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] b(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x29);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 96;
                    case 1 -> 110;
                    case 2 -> 58;
                    case 3 -> 50;
                    case 4 -> 36;
                    case 5 -> 32;
                    default -> 41;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }

    public static class Param {
        public final String name;
        public final String value;

        Param(String string, String string2) {
            this.name = string;
            this.value = string2;
        }
    }
}

