Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ type HyperConnector = HttpsConnector<HttpConnector>;
pub enum Endpoint {
/// The production environment (api.push.apple.com)
Production,
/// The development/test environment (api.development.push.apple.com)
/// The development/test environment (api.sandbox.push.apple.com)
Sandbox,
}

impl fmt::Display for Endpoint {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let host = match self {
Endpoint::Production => "api.push.apple.com",
Endpoint::Sandbox => "api.development.push.apple.com",
Endpoint::Sandbox => "api.sandbox.push.apple.com",
};

write!(f, "{}", host)
Expand Down Expand Up @@ -372,7 +372,7 @@ jDwmlD1Gg0yJt1e38djFwsxsfr5q2hv0Rj9fTEqAPr8H7mGm0wKxZ7iQ
let request = client.build_request(payload).unwrap();
let uri = format!("{}", request.uri());

assert_eq!("https://api.development.push.apple.com/3/device/a_test_id", &uri);
assert_eq!("https://api.sandbox.push.apple.com/3/device/a_test_id", &uri);
}

#[test]
Expand Down