Skip to content

Commit

Permalink
TokenAddInterceptor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed Apr 27, 2017
1 parent 7a70173 commit 5acb7df
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ public TokenAddInterceptor(String token) {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
HttpUrl originalUrl = originalRequest.url();
Request newRequest = originalRequest.newBuilder().build();

String method = originalRequest.method();
// if (method.equals("GET")) {
HttpUrl originalUrl = originalRequest.url();
Request newRequest = originalRequest.newBuilder()
if (method.equals("GET")) {
newRequest = originalRequest.newBuilder()
.url(originalUrl + "&token=" + (token == null ? getToken() : token))
.build();
// }
}
TLog.v(TAG, "intercept: url = " + newRequest.url());
return chain.proceed(newRequest);
}
Expand Down

0 comments on commit 5acb7df

Please sign in to comment.