diff options
| author | Teddy Wing | 2017-11-10 03:08:29 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2017-11-10 03:08:29 +0100 | 
| commit | 47cd439b69c4c19074e6056d299eb704c375727b (patch) | |
| tree | 072726dfb6f625df10d52c21c22518f4e5218986 | |
| parent | 274f22abbd33e083b52fc5ade828050b61a22f85 (diff) | |
| download | kipper-47cd439b69c4c19074e6056d299eb704c375727b.tar.bz2 | |
update_commit_status(): Pass authorization header with request
Authenticate our GitHub request with an `Authorization` header and API
token.
| -rw-r--r-- | src/github.rs | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/src/github.rs b/src/github.rs index 55c7ce0..de4f602 100644 --- a/src/github.rs +++ b/src/github.rs @@ -4,7 +4,7 @@ extern crate reqwest;  use std::collections::HashMap;  use std::fmt; -use self::reqwest::header::{Accept, qitem}; +use self::reqwest::header::{Accept, Authorization, Bearer, qitem};  use pull_request::CommitRef; @@ -64,6 +64,13 @@ pub fn update_commit_status(                  vec![qitem("application/vnd.github.v3+json".parse().unwrap())]              )          ) +        .header( +            Authorization( +                Bearer { +                    token: "token".to_owned() +                } +            ) +        )          .json(¶ms)          .send()          .unwrap(); | 
