Wrong HttpMethod applied by AuthContext::new_post #2

Closed
opened 5 years ago by Ghost · 2 comments
Ghost commented 5 years ago

The code

pub fn new_post<'n:'a, 'p:'a, 'u:'a, 'b:'a>(
        username : &'n str,
        password : &'p str,
        uri : &'u str,
        body : Option<&'b [u8]>
    ) -> Self {
        Self::new_with_method(username, password, uri, body, HttpMethod::GET)
    }

is applying the GET method instead of the POST method. This causes the md5(method:uri) value to be incorrectly calculated and so causes post requests to fail

The code ``` pub fn new_post<'n:'a, 'p:'a, 'u:'a, 'b:'a>( username : &'n str, password : &'p str, uri : &'u str, body : Option<&'b [u8]> ) -> Self { Self::new_with_method(username, password, uri, body, HttpMethod::GET) } ``` is applying the GET method instead of the POST method. This causes the md5(method:uri) value to be incorrectly calculated and so causes post requests to fail
Owner

Good catch, I suppose I never used that function ;)

I'll fix it ASAP

Good catch, I suppose I never used that function ;) I'll fix it ASAP
Owner

oops took a while, finally fixed

oops took a while, finally fixed
MightyPork closed this issue 5 years ago
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: packages/digest_auth_rs#2
Loading…
There is no content yet.