Skip to content

Commit

Permalink
Use the lowercase hyphenated formatter (default) when returning UUIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureMarker committed Jul 21, 2020
1 parent a363c51 commit 5cd962b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions autoendpoint/src/routers/fcm/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,7 @@ impl FcmRouter {
notification: &Notification,
) -> ApiResult<HashMap<&'static str, String>> {
let mut message_data = HashMap::new();
message_data.insert(
"chid",
notification
.subscription
.channel_id
.to_simple_ref()
.to_string(),
);
message_data.insert("chid", notification.subscription.channel_id.to_string());

// Only add the other headers if there's data
if let Some(data) = &notification.data {
Expand Down Expand Up @@ -326,7 +319,7 @@ mod tests {
"message": {
"android": {
"data": {
"chid": channel_id().to_simple().to_string()
"chid": CHANNEL_ID
},
"ttl": "60s"
},
Expand Down Expand Up @@ -360,7 +353,7 @@ mod tests {
"message": {
"android": {
"data": {
"chid": channel_id().to_simple().to_string(),
"chid": CHANNEL_ID,
"body": "test-data",
"con": "test-encoding",
"enc": "test-encryption",
Expand Down
4 changes: 2 additions & 2 deletions autoendpoint/src/routes/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ pub async fn register_uaid_route(

trace!("Finished registering UAID {}", user.uaid);
Ok(HttpResponse::Ok().json(serde_json::json!({
"uaid": user.uaid.to_simple().to_string(),
"channelID": channel_id.to_simple().to_string(),
"uaid": user.uaid,
"channelID": channel_id,
"endpoint": endpoint_url,
"secret": secret
})))
Expand Down

0 comments on commit 5cd962b

Please sign in to comment.