Change HTTP signature date format for compatibility with mastodon

This commit is contained in:
silverpill 2021-11-12 00:06:08 +00:00
parent 3fde882e1d
commit e48670c28b

View file

@ -31,7 +31,7 @@ pub fn create_http_signature(
.map_err(|_| SignatureError::UrlError)?;
let host = request_url_object.host_str()
.ok_or(SignatureError::UrlError)?;
let date = Utc::now().to_rfc2822();
let date = Utc::now().format("%a, %d %b %Y %T GMT").to_string();
let digest = get_message_digest(request_body);
let message = format!(
"(request-target): post {}\nhost: {}\ndate: {}\ndigest: {}",