Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import okhttp3.Response;

public class AuthorizationInterceptor implements Interceptor {
private static final String REQUESTED_WITH = "webapp";
private static final String USER_AGENT = "mobile_app";

@NonNull
private final LoginRepository repository;
Expand All @@ -33,10 +33,9 @@ public Response intercept(@NonNull Chain chain) throws IOException {
}
Request.Builder builder = chain.request().newBuilder();
builder.addHeader("Authorization", "bearer " + token.trim());
//builder.addHeader("Content-Type", "application/json");
builder.addHeader("User-Agent", USER_AGENT);
if(!StringUtils.isEmpty(csrfToken)){
builder.addHeader("X-Csrftoken", csrfToken);
builder.addHeader("X-Requested-With", REQUESTED_WITH);
}
Response response = chain.proceed(builder.build());
if (response.code() == HttpURLConnection.HTTP_UNAUTHORIZED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public abstract class BaseGraphQLRequest {

private static final ApolloClient apolloClient = ApolloClient.builder()
.okHttpClient(OkHttpUtils.getDefaultOkHttpClient())
.useHttpGetMethodForQueries(true)
.serverUrl(URI)
.addCustomTypeAdapter(CustomType.DATE, new DateCustomTypeAdapter())
.addCustomTypeAdapter(CustomType.DATETIME, new DateTimeCustomTypeAdapter())
Expand Down