package com.ss.android.ugc.aweme.net.interceptor;

import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.net.IReleaseInterceptor;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class DevicesNullInterceptor implements IReleaseInterceptor {
    static {
        Covode.recordClassIndex(94737);
    }

    public Response intercept(Interceptor.Chain chain) {
        Request request = chain.request();
        if (TextUtils.equals("", request.url().queryParameter("device_id"))) {
            Request.Builder newBuilder = request.newBuilder();
            HttpUrl.Builder newBuilder2 = request.url().newBuilder();
            newBuilder2.removeAllQueryParameters("device_id");
            newBuilder.url(newBuilder2.build());
            request = newBuilder.build();
        }
        return chain.proceed(request);
    }
}
