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

NewDevice succeeds on non camera devices #47

Open
brucealthompson opened this issue Feb 27, 2024 · 1 comment
Open

NewDevice succeeds on non camera devices #47

brucealthompson opened this issue Feb 27, 2024 · 1 comment

Comments

@brucealthompson
Copy link

If I provide NewDevice() with an IPaddr and port that reference a web server, it will return success as long as the website hosted on that server does not return an http error. The issue is in "func (dev *Device) getSupportedServices(resp *http.Response)" This function does not check that the response is a valid SOAP response.

@brucealthompson
Copy link
Author

I have been able to work around the issue stated above. Here are the problems I worked around:

  1. onvif depends on "github.com/beevik/etree v1.3.0" but the go.mod file does not state this requirement. I updated my project to "github.com/beevik/etree v1.3.0" and now websites return an error to NewDevice()
  2. if a site returns valid xml, NewDevice() returns success with a single service returned by device.GetServices(). I have had to add code to my application to catch this case.

It would be nice if you could fix the above issues even though I have worked around them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant