Skip to content

java.lang.UnsupportedOperationException while adding interceptor #2219

@outofdate

Description

@outofdate

3.0.0-RC1
This chunk of code is throwing exception.
So i found it out when migrating to okhttp3.

 client.interceptors().add(new Interceptor() {
            @Override
            public okhttp3.Response intercept(Chain chain) throws IOException {
                Request request = chain.request();
                Request.Builder requestBuilder = request.newBuilder()
                        .addHeader("Authorization", authPrefs.getString(Properties.ApiProperties.TOKEN, "null"))
                        .method(request.method(), request.body());

                request = requestBuilder.build();
                return chain.proceed(request);
            }
        });

Version 2.7.0 works fine for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions