File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
example-github/src/main/java/example/github Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 11/**
2- * Copyright 2012-2019 The Feign Authors
2+ * Copyright 2012-2020 The Feign Authors
33 *
44 * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55 * except in compliance with the License. You may obtain a copy of the License at
2626/** Inspired by {@code com.example.retrofit.GitHubClient} */
2727public class GitHubExample {
2828
29- private static final String GITHUB_TOKEN = "GITHUB_TOKEN" ;
30-
3129 public interface GitHub {
3230
3331 public class Repository {
@@ -78,13 +76,10 @@ static GitHub connect() {
7876 .logLevel (Logger .Level .BASIC )
7977 .requestInterceptor (
8078 template -> {
81- if (System .getenv ().containsKey (GITHUB_TOKEN )) {
82- System .out .println ("Detected Authorization token from environment variable" );
83- template .header (
84- // not available when building PRs...
85- // https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
86- "Authorization" , "token " + System .getenv (GITHUB_TOKEN ));
87- }
79+ template .header (
80+ // not available when building PRs...
81+ // https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml
82+ "Authorization" , "token 383f1c1b474d8f05a21e7964976ab0d403fee071" );
8883 })
8984 .target (GitHub .class , "https://api.github.com" );
9085 }
You can’t perform that action at this time.
0 commit comments