Skip to content
New issue

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

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

Already on GitHub? # to your account

Should return http.Response for paste? #22

Closed
chandru89new opened this issue Dec 21, 2022 · 6 comments · Fixed by #23
Closed

Should return http.Response for paste? #22

chandru89new opened this issue Dec 21, 2022 · 6 comments · Fixed by #23
Assignees
Labels
bug Something isn't working

Comments

@chandru89new
Copy link

chandru89new commented Dec 21, 2022

In this code:

        hb, hr, err := p.hibp.HTTPResBody(http.MethodGet, apiURL, nil)
	if err != nil {
		return nil, nil, err
	}

the http response is ignored and nil returned if there is any error. However, the error might come from the API call, in which case there could be a response and should be passed down this method as well. Is nil being returned intentionally?

@wneessen
Copy link
Owner

Good catch. Thanks for the report. That's definitely an oversight and not intended. I'll fix that tomorrow and create a new release.

@wneessen wneessen self-assigned this Dec 21, 2022
@wneessen wneessen added the bug Something isn't working label Dec 21, 2022
@wneessen wneessen linked a pull request Dec 22, 2022 that will close this issue
@chandru89new
Copy link
Author

Hi @wneessen thanks for the quick fix. The issue exists in breach, password APIs as well (sorry I just noticed it).

@wneessen
Copy link
Owner

Yeah, I am already working on the breaches fix as well, but wanted to keep it as a separate commit. In fact I am currently overhauling the whole error handling a bit. All coming commits will be put together in the next release.

@wneessen
Copy link
Owner

Version 1.0.5 has just been released with the corresponding fixes.
https://github.com/wneessen/go-hibp/releases/tag/v1.0.5

@chandru89new
Copy link
Author

Great work, @wneessen. We use your SDK at Steampipe and I'd like to thank you on behalf of the whole team for the SDK and the great work you've put in.

@wneessen
Copy link
Owner

Appreciate it!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants