Created
December 19, 2016 18:31
-
-
Save berinle/91c1e80b13f4d0ce1de67cd02dd20972 to your computer and use it in GitHub Desktop.
request interceptor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AuthInterceptor implements RequestInterceptor { | |
| @Override | |
| public void apply(RequestTemplate template) { | |
| Map<String, Collection<String>> headers = template.request().headers(); | |
| Collection<String> authorization = headers.get("Authorization"); | |
| if (null != authorization && !authorization.isEmpty()) { | |
| for (String s : authorization) { | |
| template.header("Authorization", s); | |
| } | |
| } | |
| ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment