glean/net/http_uploader.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5use crate::net::{CapablePingUploadRequest, PingUploader, UploadResult};
6
7/// A simple mechanism to upload pings over HTTPS.
8#[derive(Debug)]
9pub struct HttpUploader;
10
11impl PingUploader for HttpUploader {
12 /// Uploads a ping to a server.
13 ///
14 /// # Arguments
15 ///
16 /// * `upload_request` - the requested upload.
17 fn upload(&self, upload_request: CapablePingUploadRequest) -> UploadResult {
18 let upload_request = upload_request.capable(|_| true).unwrap();
19 log::debug!("TODO bug 1675468: submitting to {:?}", upload_request.url);
20 UploadResult::http_status(200)
21 }
22}