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

fix(api): return appropriate status for unauthorized requests #1116

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

hypnoglow
Copy link
Contributor

Fixes #1095

Also added the test for both cases 😊

@simskij
Copy link
Member

simskij commented Oct 31, 2021

Excellent work! Thank you! I'll have a more thorough look at the code as soon as I get an opportunity.

@simskij simskij self-requested a review October 31, 2021 21:28
@codecov
Copy link

codecov bot commented Oct 31, 2021

Codecov Report

Merging #1116 (1ef1851) into main (1b405d4) will decrease coverage by 0.46%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1116      +/-   ##
==========================================
- Coverage   61.96%   61.49%   -0.47%     
==========================================
  Files          22       23       +1     
  Lines        1438     1470      +32     
==========================================
+ Hits          891      904      +13     
- Misses        463      482      +19     
  Partials       84       84              
Impacted Files Coverage Δ
pkg/api/api.go 40.62% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b405d4...1ef1851. Read the comment docs.

Copy link
Member

@piksel piksel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. I have no idea how the commit manages to "decreases coverage by 0.46%" while also having 100% diff coverage...

pkg/api/api_test.go Outdated Show resolved Hide resolved
References issue containrrr#1095

Signed-off-by: Igor Zibarev <zibarev.i@gmail.com>
@piksel piksel changed the title Fix API status code for unauthorized requests fix(api): return appropriate status for unauthorized requests Nov 12, 2021
@piksel piksel merged commit 81036b0 into containrrr:main Nov 12, 2021
@piksel
Copy link
Member

piksel commented Nov 12, 2021

@all-contributors please add @hypnoglow for code

@allcontributors
Copy link
Contributor

@piksel

I've put up a pull request to add @hypnoglow! 🎉

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

Successfully merging this pull request may close these issues.

Watchtower API Mode always returns 200 OK status code
3 participants