| 1 | use serde_json::{Value, json}; |
| 2 | use session::{Method, Request, Session}; |
| 3 | use uuid::Uuid; |
| 4 | |
| 5 | use crate::error::{Error, Result}; |
| 6 | use crate::messages::{MessageTransport, Messages, encode, ensure_success}; |
| 7 | use crate::pins::{CsaTransport, DEFAULT_REGION, SessionTransport}; |
| 8 | |
| 9 | const LIST_VIEW: &str = "msnp24Equivalent"; |
| 10 | const USE_ACS_HEADER: &str = "x-ms-use-acs-translation"; |
| 11 | const ON_DEMAND_HEADER: &str = "x-ms-on-demand-translation"; |
| 12 | const KNOWN_LANGUAGES_HEADER: &str = "x-ms-knownLanguages"; |
| 13 | const REQUEST_ID_HEADER: &str = "x-ms-request-id"; |
| 14 | pub const MAX_TRANSLATE_BATCH: usize = 30; |
| 15 | |
| 16 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 17 | pub enum TranslationTrigger { |
| 18 | OnDemand, |
| 19 | Automatic { known_languages: Vec<String> }, |
| 20 | } |
| 21 | |
| 22 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 23 | pub struct TranslateRequest { |
| 24 | pub message_id: String, |
| 25 | pub version: Option<String>, |
| 26 | } |
| 27 | |
| 28 | impl TranslateRequest { |
| 29 | pub fn new(message_id: &str) -> Self { |
| 30 | TranslateRequest { |
| 31 | message_id: message_id.to_owned(), |
| 32 | version: None, |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 38 | pub enum TranslationStatus { |
| 39 | Done, |
| 40 | MessageNotFound, |
| 41 | VersionNotFound, |
| 42 | LanguageDetectionFailed, |
| 43 | NotNeeded, |
| 44 | Failed, |
| 45 | } |
| 46 | |
| 47 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 48 | pub struct Translation { |
| 49 | pub message_id: String, |
| 50 | pub version: Option<String>, |
| 51 | pub status: TranslationStatus, |
| 52 | pub content_html: Option<String>, |
| 53 | pub subject: Option<String>, |
| 54 | pub title: Option<String>, |
| 55 | } |
| 56 | |
| 57 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 58 | pub struct Language { |
| 59 | pub code: String, |
| 60 | pub name: String, |
| 61 | } |
| 62 | |
| 63 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 64 | pub struct MessageLanguage { |
| 65 | pub message_id: String, |
| 66 | pub stamp: String, |
| 67 | } |
| 68 | |
| 69 | /// Cuts a locale to the code the translator knows: `en-GB` is `en`, `zh-TW` is `zh-cht`, `sr-Latn-RS` is `sr-latn`. |
| 70 | pub fn language_code(locale: &str) -> String { |
| 71 | let lowered = locale.trim().replace('_', "-").to_lowercase(); |
| 72 | let mut parts = lowered.split('-'); |
| 73 | let language = parts.next().unwrap_or_default(); |
| 74 | let rest: Vec<&str> = parts.collect(); |
| 75 | if language == "zh" { |
| 76 | let traditional = rest |
| 77 | .iter() |
| 78 | .any(|part| matches!(*part, "hant" | "hk" | "tw")); |
| 79 | return if traditional { "zh-cht" } else { "zh-chs" }.to_owned(); |
| 80 | } |
| 81 | match rest.first() { |
| 82 | Some(script) if script.len() == 4 => format!("{language}-{script}"), |
| 83 | _ => language.to_owned(), |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | pub fn translate_headers(trigger: &TranslationTrigger) -> Vec<(String, String)> { |
| 88 | let mut headers = vec![ |
| 89 | ("Content-Type".to_owned(), "application/json".to_owned()), |
| 90 | (USE_ACS_HEADER.to_owned(), "true".to_owned()), |
| 91 | (REQUEST_ID_HEADER.to_owned(), Uuid::new_v4().to_string()), |
| 92 | ]; |
| 93 | match trigger { |
| 94 | TranslationTrigger::OnDemand => { |
| 95 | headers.push((ON_DEMAND_HEADER.to_owned(), "true".to_owned())) |
| 96 | } |
| 97 | TranslationTrigger::Automatic { known_languages } => { |
| 98 | headers.push((KNOWN_LANGUAGES_HEADER.to_owned(), known_languages.join(","))) |
| 99 | } |
| 100 | } |
| 101 | headers |
| 102 | } |
| 103 | |
| 104 | pub fn translate_body(messages: &[TranslateRequest]) -> Value { |
| 105 | Value::Array( |
| 106 | messages |
| 107 | .iter() |
| 108 | .map(|message| match &message.version { |
| 109 | Some(version) => json!({"id": message.message_id, "version": version}), |
| 110 | None => json!({"id": message.message_id}), |
| 111 | }) |
| 112 | .collect(), |
| 113 | ) |
| 114 | } |
| 115 | |
| 116 | fn status_for(result_code: &str) -> TranslationStatus { |
| 117 | match result_code { |
| 118 | "Success" => TranslationStatus::Done, |
| 119 | "MessageNotFound" => TranslationStatus::MessageNotFound, |
| 120 | "VersionNotFound" => TranslationStatus::VersionNotFound, |
| 121 | "LanguageDetectionFailed" => TranslationStatus::LanguageDetectionFailed, |
| 122 | "SkipTranslation" | "ContentIsEmpty" => TranslationStatus::NotNeeded, |
| 123 | _ => TranslationStatus::Failed, |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | pub fn parse_translations(body: &Value) -> Result<Vec<Translation>> { |
| 128 | let entries = body |
| 129 | .as_array() |
| 130 | .ok_or_else(|| Error::UnexpectedAnswer("no translation list".into()))?; |
| 131 | let text = |entry: &Value, key: &str| { |
| 132 | entry |
| 133 | .get(key) |
| 134 | .and_then(Value::as_str) |
| 135 | .filter(|value| !value.is_empty()) |
| 136 | .map(str::to_owned) |
| 137 | }; |
| 138 | Ok(entries |
| 139 | .iter() |
| 140 | .filter_map(|entry| { |
| 141 | let message_id = entry.get("id")?.as_str()?.to_owned(); |
| 142 | let status = status_for( |
| 143 | entry |
| 144 | .get("resultCode") |
| 145 | .and_then(Value::as_str) |
| 146 | .unwrap_or_default(), |
| 147 | ); |
| 148 | let version = match entry.get("version") { |
| 149 | Some(Value::String(version)) => Some(version.clone()), |
| 150 | Some(Value::Number(version)) => Some(version.to_string()), |
| 151 | _ => None, |
| 152 | }; |
| 153 | Some(Translation { |
| 154 | message_id, |
| 155 | version, |
| 156 | status, |
| 157 | content_html: text(entry, "translatedContent"), |
| 158 | subject: text(entry, "translatedSubject"), |
| 159 | title: text(entry, "translatedTitle"), |
| 160 | }) |
| 161 | }) |
| 162 | .collect()) |
| 163 | } |
| 164 | |
| 165 | pub fn parse_languages(body: &Value) -> Result<Vec<Language>> { |
| 166 | let entries = body |
| 167 | .as_array() |
| 168 | .ok_or_else(|| Error::UnexpectedAnswer("no language list".into()))?; |
| 169 | Ok(entries |
| 170 | .iter() |
| 171 | .filter_map(|entry| { |
| 172 | Some(Language { |
| 173 | code: entry.get("languageTag")?.as_str()?.to_owned(), |
| 174 | name: entry.get("languageName")?.as_str()?.to_owned(), |
| 175 | }) |
| 176 | }) |
| 177 | .collect()) |
| 178 | } |
| 179 | |
| 180 | pub fn parse_message_languages(body: &Value) -> Vec<MessageLanguage> { |
| 181 | body.get("messages") |
| 182 | .and_then(Value::as_array) |
| 183 | .into_iter() |
| 184 | .flatten() |
| 185 | .filter_map(|message| { |
| 186 | Some(MessageLanguage { |
| 187 | message_id: message.get("id")?.as_str()?.to_owned(), |
| 188 | stamp: message |
| 189 | .pointer("/properties/languageStamp")? |
| 190 | .as_str()? |
| 191 | .to_owned(), |
| 192 | }) |
| 193 | }) |
| 194 | .collect() |
| 195 | } |
| 196 | |
| 197 | pub struct Translator<T: CsaTransport = SessionTransport> { |
| 198 | transport: T, |
| 199 | api_url: String, |
| 200 | } |
| 201 | |
| 202 | impl Translator<SessionTransport> { |
| 203 | pub fn new(session: &Session) -> Self { |
| 204 | Self::with_region(session, DEFAULT_REGION) |
| 205 | } |
| 206 | |
| 207 | pub fn with_region(session: &Session, region: &str) -> Self { |
| 208 | Translator::with_transport(SessionTransport::new(session), region) |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | impl<T: CsaTransport> Translator<T> { |
| 213 | pub fn with_transport(transport: T, region: &str) -> Self { |
| 214 | Translator { |
| 215 | transport, |
| 216 | api_url: format!("https://teams.cloud.microsoft/api/csa/{region}/api/v1"), |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | pub fn chat_url(&self, chat_id: &str, to_language: &str) -> String { |
| 221 | format!( |
| 222 | "{}/chats/{}/messages/languages/{}", |
| 223 | self.api_url, |
| 224 | encode(chat_id), |
| 225 | encode(to_language) |
| 226 | ) |
| 227 | } |
| 228 | |
| 229 | pub fn channel_url( |
| 230 | &self, |
| 231 | team_id: &str, |
| 232 | channel_id: &str, |
| 233 | root_id: &str, |
| 234 | to_language: &str, |
| 235 | ) -> String { |
| 236 | format!( |
| 237 | "{}/teams/{}/channels/{}/{}/messages/languages/{}", |
| 238 | self.api_url, |
| 239 | encode(team_id), |
| 240 | encode(channel_id), |
| 241 | encode(root_id), |
| 242 | encode(to_language) |
| 243 | ) |
| 244 | } |
| 245 | |
| 246 | pub async fn translate_chat( |
| 247 | &self, |
| 248 | chat_id: &str, |
| 249 | to_language: &str, |
| 250 | messages: &[TranslateRequest], |
| 251 | trigger: &TranslationTrigger, |
| 252 | ) -> Result<Vec<Translation>> { |
| 253 | let url = self.chat_url(chat_id, to_language); |
| 254 | self.translate(url, messages, trigger).await |
| 255 | } |
| 256 | |
| 257 | pub async fn translate_channel( |
| 258 | &self, |
| 259 | team_id: &str, |
| 260 | channel_id: &str, |
| 261 | root_id: &str, |
| 262 | to_language: &str, |
| 263 | messages: &[TranslateRequest], |
| 264 | trigger: &TranslationTrigger, |
| 265 | ) -> Result<Vec<Translation>> { |
| 266 | let url = self.channel_url(team_id, channel_id, root_id, to_language); |
| 267 | self.translate(url, messages, trigger).await |
| 268 | } |
| 269 | |
| 270 | pub async fn languages(&self, ui_locale: &str) -> Result<Vec<Language>> { |
| 271 | let mut request = Request::get(format!( |
| 272 | "{}/translator/languages?locale={}", |
| 273 | self.api_url, |
| 274 | encode(ui_locale) |
| 275 | )); |
| 276 | request.headers = vec![(USE_ACS_HEADER.to_owned(), "true".to_owned())]; |
| 277 | let answer = self.transport.send(request).await?; |
| 278 | ensure_success(&answer)?; |
| 279 | parse_languages(&answer.body) |
| 280 | } |
| 281 | |
| 282 | async fn translate( |
| 283 | &self, |
| 284 | url: String, |
| 285 | messages: &[TranslateRequest], |
| 286 | trigger: &TranslationTrigger, |
| 287 | ) -> Result<Vec<Translation>> { |
| 288 | let mut request = Request::with_body(Method::Post, url, translate_body(messages)); |
| 289 | request.headers = translate_headers(trigger); |
| 290 | let answer = self.transport.send(request).await?; |
| 291 | ensure_success(&answer)?; |
| 292 | parse_translations(&answer.body) |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | impl<T: MessageTransport> Messages<T> { |
| 297 | pub async fn list_language_stamps( |
| 298 | &self, |
| 299 | conversation: &crate::messages::ConversationRef, |
| 300 | page_size: usize, |
| 301 | ) -> Result<Vec<MessageLanguage>> { |
| 302 | let url = format!( |
| 303 | "{}/{}/messages?view={LIST_VIEW}&pageSize={page_size}", |
| 304 | self.base_url, |
| 305 | encode(&conversation.conversation_id()) |
| 306 | ); |
| 307 | let answer = self.transport.send(Request::get(&url)).await?; |
| 308 | ensure_success(&answer)?; |
| 309 | Ok(parse_message_languages(&answer.body)) |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | #[cfg(test)] |
| 314 | mod tests { |
| 315 | use std::collections::VecDeque; |
| 316 | use std::sync::Mutex; |
| 317 | |
| 318 | use session::ApiResponse; |
| 319 | |
| 320 | use super::*; |
| 321 | |
| 322 | struct Canned { |
| 323 | answers: Mutex<VecDeque<(u16, Value)>>, |
| 324 | requests: Mutex<Vec<Request>>, |
| 325 | } |
| 326 | |
| 327 | impl Canned { |
| 328 | fn new(answers: Vec<(u16, Value)>) -> Self { |
| 329 | Canned { |
| 330 | answers: Mutex::new(answers.into()), |
| 331 | requests: Mutex::new(Vec::new()), |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | impl CsaTransport for &Canned { |
| 337 | async fn send(&self, request: Request) -> Result<ApiResponse> { |
| 338 | self.requests.lock().unwrap().push(request); |
| 339 | let (status, body) = self.answers.lock().unwrap().pop_front().expect("exhausted"); |
| 340 | Ok(ApiResponse { |
| 341 | status, |
| 342 | body, |
| 343 | retry_after: None, |
| 344 | }) |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | fn header<'a>(request: &'a Request, name: &str) -> Option<&'a str> { |
| 349 | request |
| 350 | .headers |
| 351 | .iter() |
| 352 | .find(|(key, _)| key == name) |
| 353 | .map(|(_, value)| value.as_str()) |
| 354 | } |
| 355 | |
| 356 | #[test] |
| 357 | fn locales_map_to_translator_codes() { |
| 358 | assert_eq!(language_code("en-GB"), "en"); |
| 359 | assert_eq!(language_code("de_DE"), "de"); |
| 360 | assert_eq!(language_code("zh-TW"), "zh-cht"); |
| 361 | assert_eq!(language_code("zh-Hant-HK"), "zh-cht"); |
| 362 | assert_eq!(language_code("zh-CN"), "zh-chs"); |
| 363 | assert_eq!(language_code("zh"), "zh-chs"); |
| 364 | assert_eq!(language_code("sr-Latn-RS"), "sr-latn"); |
| 365 | assert_eq!(language_code("FR"), "fr"); |
| 366 | } |
| 367 | |
| 368 | #[test] |
| 369 | fn on_demand_requests_force_and_send_no_known_languages() { |
| 370 | let headers = translate_headers(&TranslationTrigger::OnDemand); |
| 371 | let find = |name: &str| headers.iter().find(|(key, _)| key == name); |
| 372 | assert_eq!(find(USE_ACS_HEADER).unwrap().1, "true"); |
| 373 | assert_eq!(find(ON_DEMAND_HEADER).unwrap().1, "true"); |
| 374 | assert!(find(KNOWN_LANGUAGES_HEADER).is_none()); |
| 375 | assert_eq!(find("Content-Type").unwrap().1, "application/json"); |
| 376 | assert!(Uuid::parse_str(&find(REQUEST_ID_HEADER).unwrap().1).is_ok()); |
| 377 | } |
| 378 | |
| 379 | #[test] |
| 380 | fn automatic_requests_send_the_known_languages_instead() { |
| 381 | let headers = translate_headers(&TranslationTrigger::Automatic { |
| 382 | known_languages: vec!["en".into(), "de".into()], |
| 383 | }); |
| 384 | let find = |name: &str| headers.iter().find(|(key, _)| key == name); |
| 385 | assert_eq!(find(KNOWN_LANGUAGES_HEADER).unwrap().1, "en,de"); |
| 386 | assert!(find(ON_DEMAND_HEADER).is_none()); |
| 387 | assert_eq!(find(USE_ACS_HEADER).unwrap().1, "true"); |
| 388 | } |
| 389 | |
| 390 | #[test] |
| 391 | fn body_lists_ids_and_optional_versions() { |
| 392 | let body = translate_body(&[ |
| 393 | TranslateRequest::new("1"), |
| 394 | TranslateRequest { |
| 395 | message_id: "2".into(), |
| 396 | version: Some("7".into()), |
| 397 | }, |
| 398 | ]); |
| 399 | assert_eq!(body, json!([{"id": "1"}, {"id": "2", "version": "7"}])); |
| 400 | } |
| 401 | |
| 402 | #[test] |
| 403 | fn parses_success_and_not_found_results() { |
| 404 | let parsed = parse_translations(&json!([ |
| 405 | {"id": "1", "version": 1700, "languageId": "en", "detectedLanguage": {"languageId": null, "score": 1}, |
| 406 | "translatedContent": "<p>Hello</p>", "translatedSubject": null, "translatedTitle": null, "resultCode": "Success"}, |
| 407 | {"id": "2", "resultCode": "MessageNotFound", "translatedContent": null}, |
| 408 | {"id": "3", "resultCode": "ContentIsEmpty"}, |
| 409 | {"id": "4", "resultCode": "Strange"}, |
| 410 | {"resultCode": "Success"}, |
| 411 | ])) |
| 412 | .unwrap(); |
| 413 | assert_eq!(parsed.len(), 4); |
| 414 | assert_eq!(parsed[0].status, TranslationStatus::Done); |
| 415 | assert_eq!(parsed[0].version.as_deref(), Some("1700")); |
| 416 | assert_eq!(parsed[0].content_html.as_deref(), Some("<p>Hello</p>")); |
| 417 | assert_eq!(parsed[1].status, TranslationStatus::MessageNotFound); |
| 418 | assert_eq!(parsed[1].content_html, None); |
| 419 | assert_eq!(parsed[2].status, TranslationStatus::NotNeeded); |
| 420 | assert_eq!(parsed[3].status, TranslationStatus::Failed); |
| 421 | } |
| 422 | |
| 423 | #[test] |
| 424 | fn a_non_list_answer_is_unexpected() { |
| 425 | assert!(parse_translations(&json!("Bad request.")).is_err()); |
| 426 | } |
| 427 | |
| 428 | #[test] |
| 429 | fn parses_language_list_and_stamps() { |
| 430 | let languages = parse_languages(&json!([ |
| 431 | {"languageTag": "de", "languageName": "German"}, |
| 432 | {"languageTag": "zh-chs", "languageName": "Chinese (Simplified)"}, |
| 433 | {"languageTag": "x"}, |
| 434 | ])) |
| 435 | .unwrap(); |
| 436 | assert_eq!( |
| 437 | languages, |
| 438 | vec![ |
| 439 | Language { |
| 440 | code: "de".into(), |
| 441 | name: "German".into() |
| 442 | }, |
| 443 | Language { |
| 444 | code: "zh-chs".into(), |
| 445 | name: "Chinese (Simplified)".into() |
| 446 | }, |
| 447 | ] |
| 448 | ); |
| 449 | let stamps = parse_message_languages(&json!({"messages": [ |
| 450 | {"id": "1", "properties": {"languageStamp": "languages=de:100;length:82;&detector=Bling"}}, |
| 451 | {"id": "2", "properties": {}}, |
| 452 | {"id": "3"}, |
| 453 | ]})); |
| 454 | assert_eq!( |
| 455 | stamps, |
| 456 | vec![MessageLanguage { |
| 457 | message_id: "1".into(), |
| 458 | stamp: "languages=de:100;length:82;&detector=Bling".into() |
| 459 | }] |
| 460 | ); |
| 461 | } |
| 462 | |
| 463 | #[tokio::test] |
| 464 | async fn chat_translation_posts_ids_to_the_language_route_with_the_headers() { |
| 465 | let transport = Canned::new(vec![( |
| 466 | 200, |
| 467 | json!([{"id": "m1", "resultCode": "Success", "translatedContent": "<p>Hi</p>"}]), |
| 468 | )]); |
| 469 | let translator = Translator::with_transport(&transport, "emea"); |
| 470 | let translations = translator |
| 471 | .translate_chat( |
| 472 | "19:a@thread.v2", |
| 473 | "en", |
| 474 | &[TranslateRequest::new("m1")], |
| 475 | &TranslationTrigger::OnDemand, |
| 476 | ) |
| 477 | .await |
| 478 | .unwrap(); |
| 479 | assert_eq!(translations[0].content_html.as_deref(), Some("<p>Hi</p>")); |
| 480 | let requests = transport.requests.lock().unwrap(); |
| 481 | assert_eq!(requests[0].method, Method::Post); |
| 482 | assert_eq!( |
| 483 | requests[0].url, |
| 484 | "https://teams.cloud.microsoft/api/csa/emea/api/v1/chats/19%3Aa%40thread.v2/messages/languages/en" |
| 485 | ); |
| 486 | assert_eq!(requests[0].body, Some(json!([{"id": "m1"}]))); |
| 487 | assert_eq!(header(&requests[0], USE_ACS_HEADER), Some("true")); |
| 488 | assert_eq!(header(&requests[0], ON_DEMAND_HEADER), Some("true")); |
| 489 | } |
| 490 | |
| 491 | #[tokio::test] |
| 492 | async fn channel_translation_uses_the_root_message_route() { |
| 493 | let transport = Canned::new(vec![(200, json!([]))]); |
| 494 | Translator::with_transport(&transport, "emea") |
| 495 | .translate_channel( |
| 496 | "team1", |
| 497 | "19:c@thread.tacv2", |
| 498 | "root1", |
| 499 | "fr", |
| 500 | &[TranslateRequest::new("m1")], |
| 501 | &TranslationTrigger::OnDemand, |
| 502 | ) |
| 503 | .await |
| 504 | .unwrap(); |
| 505 | assert_eq!( |
| 506 | transport.requests.lock().unwrap()[0].url, |
| 507 | "https://teams.cloud.microsoft/api/csa/emea/api/v1/teams/team1/channels/19%3Ac%40thread.tacv2/root1/messages/languages/fr" |
| 508 | ); |
| 509 | } |
| 510 | |
| 511 | #[tokio::test] |
| 512 | async fn a_rejected_request_is_an_error() { |
| 513 | let transport = Canned::new(vec![(400, json!("Bad request."))]); |
| 514 | let outcome = Translator::with_transport(&transport, "emea") |
| 515 | .translate_chat( |
| 516 | "c", |
| 517 | "xx", |
| 518 | &[TranslateRequest::new("m1")], |
| 519 | &TranslationTrigger::OnDemand, |
| 520 | ) |
| 521 | .await; |
| 522 | assert!(outcome.is_err()); |
| 523 | } |
| 524 | |
| 525 | #[tokio::test] |
| 526 | async fn language_list_asks_with_the_ui_locale_and_the_acs_header() { |
| 527 | let transport = Canned::new(vec![( |
| 528 | 200, |
| 529 | json!([{"languageTag": "de", "languageName": "German"}]), |
| 530 | )]); |
| 531 | let languages = Translator::with_transport(&transport, "emea") |
| 532 | .languages("en-gb") |
| 533 | .await |
| 534 | .unwrap(); |
| 535 | assert_eq!(languages.len(), 1); |
| 536 | let requests = transport.requests.lock().unwrap(); |
| 537 | assert_eq!(requests[0].method, Method::Get); |
| 538 | assert!( |
| 539 | requests[0] |
| 540 | .url |
| 541 | .ends_with("/translator/languages?locale=en-gb") |
| 542 | ); |
| 543 | assert_eq!(header(&requests[0], USE_ACS_HEADER), Some("true")); |
| 544 | } |
| 545 | } |