Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.util.Log;
import org.apache.http.Header;

import org.apache.http.client.methods.HttpUriRequest;

public class Main {
    private static final String LOG_TAG = "ClientLoginHelper";
    private static final String AUTHORIZATION_HEADER_PREFIX = "GoogleLogin auth=";

    private static void removeGoogleAuthHeaders(HttpUriRequest request) {
        for (Header header : request.getAllHeaders()) {
            if (header.getName().equalsIgnoreCase("Authorization")
                    && header.getValue().startsWith(AUTHORIZATION_HEADER_PREFIX)) {
                Log.i(LOG_TAG, "Removing header:" + header);
                request.removeHeader(header);
            }
        }
    }
}