forked from cloudfoundry/stratos
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry pick commit 69ac7dc from other branch; now works without any r…
…estrictions; original commit message: (#45) Apply patch from freudl#1 manually This results in a version that works, but only when run with GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn or compiled with -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" This has to be adressed with an update to the cf dependencies to at least version 9
- Loading branch information
1 parent
bce7ac3
commit 21ac64f
Showing
4 changed files
with
113 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package cloudfoundry | ||
|
||
import "net/http" | ||
|
||
type LogCacheHttpClient struct { | ||
httpClient *http.Client | ||
accessToken func() string | ||
} | ||
|
||
func NewLogCacheHttpClient(accessToken func() string) *LogCacheHttpClient { | ||
return &LogCacheHttpClient{ | ||
httpClient: http.DefaultClient, | ||
accessToken: accessToken, | ||
} | ||
} | ||
|
||
func (c *LogCacheHttpClient) Do(req *http.Request) (*http.Response, error) { | ||
req.Header.Set("Authorization", c.accessToken()) | ||
return c.httpClient.Do(req) | ||
} |