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

Fixed CORS filtering fail causing print of stacktrace in HTTP Response #3294

Merged
merged 5 commits into from
Apr 15, 2021

Conversation

Coduz
Copy link
Contributor

@Coduz Coduz commented Apr 15, 2021

This PR fixes the behaviour of the CORS request Filter to return an error with stacktraces when a CORS request is not valid.

Related Issue
This PR is complementary to PR #3278 and #3292

Description of the solution adopted
Replaced throw new ServletException with httpResponse.sendError

Screenshots
None

Any side note on the changes made
Small improvements to the code and the message logging

Coduz added 4 commits April 15, 2021 14:31
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
@Coduz Coduz added the Bug This is a bug or an unexpected behaviour. Fix it! label Apr 15, 2021
@Coduz Coduz requested a review from lorthirk April 15, 2021 13:21
@codecov
Copy link

codecov bot commented Apr 15, 2021

Codecov Report

Merging #3294 (825eca4) into develop (c345545) will decrease coverage by 0.31%.
The diff coverage is 0.00%.

❗ Current head 825eca4 differs from pull request most recent head 012a01f. Consider uploading reports for the commit 012a01f to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3294      +/-   ##
=============================================
- Coverage      54.13%   53.82%   -0.32%     
+ Complexity       787      784       -3     
=============================================
  Files           1475     1475              
  Lines          30150    30152       +2     
  Branches        2520     2521       +1     
=============================================
- Hits           16322    16229      -93     
- Misses         12909    12994      +85     
- Partials         919      929      +10     
Impacted Files Coverage Δ Complexity Δ
.../kapua/app/api/core/filter/CORSResponseFilter.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...t/exception/DeviceManagementTimeoutErrorCodes.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...nt/exception/DeviceManagementTimeoutException.java 0.00% <0.00%> (-75.00%) 0.00% <0.00%> (ø%)
...a/service/account/internal/AccountCreatorImpl.java 48.57% <0.00%> (-51.43%) 0.00% <0.00%> (ø%)
...pua/job/engine/exception/JobResumingException.java 0.00% <0.00%> (-25.00%) 0.00% <0.00%> (ø%)
...a/service/account/internal/AccountServiceImpl.java 60.71% <0.00%> (-24.29%) 0.00% <0.00%> (ø%)
...stractKapuaConfigurableResourceLimitedService.java 76.19% <0.00%> (-9.53%) 0.00% <0.00%> (ø%)
...kapua/job/engine/exception/JobEngineException.java 54.54% <0.00%> (-9.10%) 0.00% <0.00%> (ø%)
...apua/job/engine/jbatch/JobEngineServiceJbatch.java 43.51% <0.00%> (-8.34%) 7.00% <0.00%> (-1.00%)
...ce/management/commons/call/DeviceCallExecutor.java 58.13% <0.00%> (-4.66%) 0.00% <0.00%> (ø%)
... and 12 more

Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
@Coduz Coduz merged commit 3bd5e28 into eclipse-kapua:develop Apr 15, 2021
@Coduz Coduz deleted the fix-corsFilterServletException branch April 15, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug or an unexpected behaviour. Fix it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants