File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ trait PullRequestService {
42
42
43
43
/** Pull Request HTTP service */
44
44
val prService = HttpService {
45
+ case GET -> Root / " rate" => {
46
+ val client = PooledHttp1Client ()
47
+ for {
48
+ rates <- client.expect(get(rateLimit))(EntityDecoder .text)
49
+ resp <- Ok (rates)
50
+ _ <- client.shutdown
51
+ } yield resp
52
+ }
53
+
45
54
case request @ POST -> Root =>
46
55
val githubEvent =
47
56
request.headers
@@ -77,6 +86,8 @@ trait PullRequestService {
77
86
private [this ] def withGithubSecret (url : String , extras : String * ): String =
78
87
s " $url?client_id= $githubClientId&client_secret= $githubClientSecret" + extras.mkString(" &" , " &" , " " )
79
88
89
+ def rateLimit : String = withGithubSecret(" https://api.github.com/rate_limit" )
90
+
80
91
def claUrl (userName : String ): String =
81
92
s " https://www.lightbend.com/contribute/cla/scala/check/ $userName"
82
93
You can’t perform that action at this time.
0 commit comments