actix / actix-extras
Showing 1 of 1 files from the diff.

@@ -250,7 +250,7 @@
Loading
250 250
251 251
impl ProtoBufResponseBuilder for HttpResponseBuilder {
252 252
    fn protobuf<T: Message>(&mut self, value: T) -> Result<HttpResponse, Error> {
253 -
        self.append_header((CONTENT_TYPE, "application/protobuf"));
253 +
        self.insert_header((CONTENT_TYPE, "application/protobuf"));
254 254
255 255
        let mut body = Vec::new();
256 256
        value
@@ -296,10 +296,8 @@
Loading
296 296
        });
297 297
        let req = TestRequest::default().to_http_request();
298 298
        let resp = protobuf.respond_to(&req).await.unwrap();
299 -
        assert_eq!(
300 -
            resp.headers().get(header::CONTENT_TYPE).unwrap(),
301 -
            "application/protobuf"
302 -
        );
299 +
        let ct = resp.headers().get(header::CONTENT_TYPE).unwrap();
300 +
        assert_eq!(ct, "application/protobuf");
303 301
    }
304 302
305 303
    #[actix_rt::test]
@@ -309,14 +307,14 @@
Loading
309 307
        assert_eq!(protobuf.err().unwrap(), ProtoBufPayloadError::ContentType);
310 308
311 309
        let (req, mut pl) = TestRequest::get()
312 -
            .append_header((header::CONTENT_TYPE, "application/text"))
310 +
            .insert_header((header::CONTENT_TYPE, "application/text"))
313 311
            .to_http_parts();
314 312
        let protobuf = ProtoBufMessage::<MyObject>::new(&req, &mut pl).await;
315 313
        assert_eq!(protobuf.err().unwrap(), ProtoBufPayloadError::ContentType);
316 314
317 315
        let (req, mut pl) = TestRequest::get()
318 -
            .append_header((header::CONTENT_TYPE, "application/protobuf"))
319 -
            .append_header((header::CONTENT_LENGTH, "10000"))
316 +
            .insert_header((header::CONTENT_TYPE, "application/protobuf"))
317 +
            .insert_header((header::CONTENT_LENGTH, "10000"))
320 318
            .to_http_parts();
321 319
        let protobuf = ProtoBufMessage::<MyObject>::new(&req, &mut pl)
322 320
            .limit(100)
Files Coverage
actix-cors 91.55%
actix-redis 82.47%
actix-session/src 89.67%
actix-web-httpauth/src 61.01%
actix-identity/src/lib.rs 95.94%
actix-protobuf/src/lib.rs 50.00%
Project Totals (29 files) 82.33%
1
comment: false
2

3
ignore: # ignore codecoverage on following paths
4
  - "**/examples"
5
  - ".github"
6
  - "**/*.md"
7
  - "**/*.toml"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading