Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow user to custom interceptor, including loggingInterceptor #1415

Open
trinhnx opened this issue Aug 29, 2024 · 0 comments

Comments

@trinhnx
Copy link

trinhnx commented Aug 29, 2024

Thank you for your great work!
I used line-bot-sdk version 8.6.0 and it is helpful.
There are two points i think we could improve for better configuration

  1. Add support for adding OkHttp3.Interceptor, instead of your own Interceptor one
    https://github.com/line/line-bot-sdk-java/blob/master/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/ApiClientBuilder.java#L133-L139
    Currently we use CurlInterceptor and with your given API there is no way to adapt current interceptor to HttpInterceptor
    Suggestion code is simple as
    public ApiClientBuilder<T> addInterceptor(Interceptor interceptor) {
        this.additionalInterceptors.add(interceptor);
        return this;
    }
  1. Do not set buildLoggingInterceptor as a default one.
    Though we can configure the log level to filter out the log, but you may provide that interceptor as an optional so Developer can use it or not.

For example i just only want to log some header then I have to

  • Disable that current logging interceptor
  • Create my own interceptor to have same logging functionality
    it is not so connivence

Thank you so much for your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants