package com.andrey7mel.testrx.model.api;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.logging.HttpLoggingInterceptor;

import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import retrofit.RxJavaCallAdapterFactory;

public class ApiModule {

    private static final boolean ENABLE_AUTH = false;
    private static final boolean ENABLE_LOG = true;

    private static final String AUTH_64 = "***";


    public static ApiInterface getApiInterface() {

        OkHttpClient httpClient = new OkHttpClient();
        if (ENABLE_AUTH) {
            httpClient.interceptors().add(chain -> {
                Request original = chain.request();
                Request request = original.newBuilder()
                        .header("Authorization", "Basic " + AUTH_64)
                        .method(original.method(), original.body())
                        .build();

                return chain.proceed(request);
            });
        }

        if (ENABLE_LOG) {
            HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
            interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            httpClient.interceptors().add(interceptor);
        }

        Retrofit.Builder builder = new Retrofit.Builder().
                baseUrl("https://api.github.com/")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create());

        builder.client(httpClient);

        ApiInterface apiInterface = builder.build().create(ApiInterface.class);
        return apiInterface;
    }

}

@@ -303,16 +303,68 @@
 Module %7B
+%0A    private static final boolean ENABLE_LOG = true;
 %0A%0A    pr
@@ -415,61 +415,8 @@
 se;%0A
-    private static final boolean ENABLE_LOG = true;%0A%0A
     
@@ -564,24 +564,25 @@
 tpClient();%0A
+%0A
         if (

fix api