Your ROOT_URL in app.ini is https://git.ondrovo.com/ but you are visiting http://159.69.29.240:49153/JamesMc86/digest_auth_rs/commit/8f9cc6a66030e32601eeb45047bc380ed67e3fc1?style=unified&whitespace=ignore-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
8 additions and
8 deletions
src/digest.rs
src/enums.rs
@ -32,7 +32,7 @@ impl QuoteForDigest for String {
}
/// Join a Vec of Display items using a separator
fn join_vec < T : ToString > ( vec : & Vec < T > , sep : & str ) -> String {
fn join_vec < T : ToString > ( vec : & [ T ] , sep : & str ) -> String {
vec . iter ( )
. map ( ToString ::to_string )
. collect ::< Vec < _ > > ( )
@ -507,8 +507,8 @@ impl AuthorizationHeader {
None = > {
let mut rng = rand ::thread_rng ( ) ;
let nonce_bytes : [ u8 ; 16 ] = rng . gen ( ) ;
let cnonce = hex ::encode ( nonce_bytes ) ;
c nonce
hex ::encode ( nonce_bytes )
}
}
} ;
@ -654,7 +654,7 @@ impl AuthorizationHeader {
} ;
if auth . qop . is_some ( ) {
if ! auth . cnonce . is_som e ( ) {
if auth . cnonce . is_non e ( ) {
return Err ( MissingRequired ( "cnonce" , input . into ( ) ) ) ;
}
} else {
@ -30,7 +30,7 @@ impl Algorithm {
}
/// Calculate a hash of bytes using the selected algorithm
pub fn hash ( & self , bytes : & [ u8 ] ) -> String {
pub fn hash ( self , bytes : & [ u8 ] ) -> String {
let mut hash : Box < dyn DynDigest > = match self . algo {
AlgorithmType ::MD5 = > Box ::new ( Md5 ::new ( ) ) ,
AlgorithmType ::SHA2_256 = > Box ::new ( Sha256 ::new ( ) ) ,
@ -42,7 +42,7 @@ impl Algorithm {
}
/// Calculate a hash of string's bytes using the selected algorithm
pub fn hash_str ( & self , bytes : & str ) -> String {
pub fn hash_str ( self , bytes : & str ) -> String {
self . hash ( bytes . as_bytes ( ) )
}
}