From 6f635ac9fab8da657d388b675dc5fc0f9846f282 Mon Sep 17 00:00:00 2001 From: James Wykeham-Martin Date: Sun, 10 Dec 2017 07:58:00 +0000 Subject: [PATCH] Updated client.get request headers --- hammond-data/src/models/queryables.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hammond-data/src/models/queryables.rs b/hammond-data/src/models/queryables.rs index f0cab54..ce0d3f6 100644 --- a/hammond-data/src/models/queryables.rs +++ b/hammond-data/src/models/queryables.rs @@ -376,17 +376,21 @@ impl<'a> Source { /// Consumes `self` and Returns the corresponding `Feed` Object. // TODO: Refactor into TryInto once it lands on stable. pub fn into_feed(mut self) -> Result { - use reqwest::header::{ETag, EntityTag, Headers, HttpDate, LastModified}; + use reqwest::header::{EntityTag, Headers, HttpDate, IfNoneMatch, IfModifiedSince}; let mut headers = Headers::new(); if let Some(foo) = self.http_etag() { - headers.set(ETag(EntityTag::new(true, foo.to_owned()))); + headers.set( + IfNoneMatch::Items(vec![ + EntityTag::new(true, foo.to_owned()) + ]) + ); } if let Some(foo) = self.last_modified() { if let Ok(x) = foo.parse::() { - headers.set(LastModified(x)); + headers.set(IfModifiedSince(x)); } }