-
Notifications
You must be signed in to change notification settings - Fork 867
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(dashboard): correct mime type is returned. Fixes: #2290 #2303
fix(dashboard): correct mime type is returned. Fixes: #2290 #2303
Conversation
fix: when request /index.html, base path was not modified fix: wrong 'err' variable used when log.Errorf("Failed to stat file or dir %s: %v"...) was printed change: when a file is not found, 404 is return (before: the index.html was returned) add: tests for static files serving Signed-off-by: nitram509 <[email protected]>
Codecov ReportBase: 82.38% // Head: 81.54% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2303 +/- ##
==========================================
- Coverage 82.38% 81.54% -0.84%
==========================================
Files 121 123 +2
Lines 18476 18855 +379
==========================================
+ Hits 15221 15375 +154
- Misses 2468 2694 +226
+ Partials 787 786 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
❓ I wonder 🤔 why the test-coverage went down? PS: I just measured the test coverage of the new file created, this is 87% (according to IntelliJ). |
done ✅ |
… router Signed-off-by: nitram509 <[email protected]>
Can you fix DCO I think your merge commit missed it, then this will be good to merge thanks for contributing! |
Sure, will take care of it. |
Signed-off-by: nitram509 <[email protected]>
c563cef
to
dca346b
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
fixed the DCO |
…rgoproj#2303) * fix: correct mimetype is returned fix: when request /index.html, base path was not modified fix: wrong 'err' variable used when log.Errorf("Failed to stat file or dir %s: %v"...) was printed change: when a file is not found, 404 is return (before: the index.html was returned) add: tests for static files serving Signed-off-by: nitram509 <[email protected]> * fix sonar cloud complains about invalid HTML See https://sonarcloud.io/project/issues?resolved=false&types=BUG&pullRequest=2303&id=argoproj_argo-rollouts&open=AYO5y8lxtb83AIZrmShZ Signed-off-by: nitram509 <[email protected]> * fix send index.html when page not found, because client side React UI router Signed-off-by: nitram509 <[email protected]> * make variable private (feedback from review) Signed-off-by: nitram509 <[email protected]> Signed-off-by: nitram509 <[email protected]>
…rgoproj#2303) * fix: correct mimetype is returned fix: when request /index.html, base path was not modified fix: wrong 'err' variable used when log.Errorf("Failed to stat file or dir %s: %v"...) was printed change: when a file is not found, 404 is return (before: the index.html was returned) add: tests for static files serving Signed-off-by: nitram509 <[email protected]> * fix sonar cloud complains about invalid HTML See https://sonarcloud.io/project/issues?resolved=false&types=BUG&pullRequest=2303&id=argoproj_argo-rollouts&open=AYO5y8lxtb83AIZrmShZ Signed-off-by: nitram509 <[email protected]> * fix send index.html when page not found, because client side React UI router Signed-off-by: nitram509 <[email protected]> * make variable private (feedback from review) Signed-off-by: nitram509 <[email protected]> Signed-off-by: nitram509 <[email protected]>
* fix: correct mimetype is returned fix: when request /index.html, base path was not modified fix: wrong 'err' variable used when log.Errorf("Failed to stat file or dir %s: %v"...) was printed change: when a file is not found, 404 is return (before: the index.html was returned) add: tests for static files serving Signed-off-by: nitram509 <[email protected]> * fix sonar cloud complains about invalid HTML See https://sonarcloud.io/project/issues?resolved=false&types=BUG&pullRequest=2303&id=argoproj_argo-rollouts&open=AYO5y8lxtb83AIZrmShZ Signed-off-by: nitram509 <[email protected]> * fix send index.html when page not found, because client side React UI router Signed-off-by: nitram509 <[email protected]> * make variable private (feedback from review) Signed-off-by: nitram509 <[email protected]> Signed-off-by: nitram509 <[email protected]>
comments about this PR
I did refactor the code for static file serving into its own file.
Overall, I also did simplify the code and fixed former issues (see below).
Golang's mime package comes to the rescue when determining the correct mime type.
relates to #2290
PS: I would like to participate the hacktoberfest and would appreciated the 'hacktoberfest-accepted' label, IF you're OK with it :)
PPS: any feedback is welcome.
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.