Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Getting 400-Bad Request instead of 401 Unauthorized #12

Open
Maciuee opened this issue Dec 7, 2023 · 1 comment
Open

[Bug] Getting 400-Bad Request instead of 401 Unauthorized #12

Maciuee opened this issue Dec 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Maciuee
Copy link

Maciuee commented Dec 7, 2023

Hi, im using this library to make HTTP POST request(soap xml) to devices which supports Onvif standard. I have truble with some device, besause i can't authorize my request.
Usually it works like:

  • program sends empty request to server
  • server response 401 unauthorized with digest authorize data
  • program sends authorized request with xml data
  • server response 200 OK

When i try send request to another device, it looks like:

  • program sends empty request to server
  • server response 400 Bad Request without digest authorize data

I think the problem is that, first request does not contain data/xml and device does't want to answer to this empty request, so it answers "Bad Request".
Is it possible to send this first requst with data, to get response 401 unauthorized with digest authorize data?

@Maciuee Maciuee added the bug Something isn't working label Dec 7, 2023
@bernardbr
Copy link
Collaborator

Hello @Maciuee !

I'm sorry for not getting back to you sooner.

Yes, it would also be possible to copy the payload (body) of the request. We didn't do this because, in theory, the authorization pipelines take place before the content validation pipelines. So we never had to send the body information.

Feel free to open a PR with the adjustment and we'll be happy to integrate it into the next version.

@bernardbr bernardbr added enhancement New feature or request and removed bug Something isn't working labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants