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

chore: add Redirect from old icon endpoint [DHIS2-16042] #15802

Merged
merged 5 commits into from
Dec 5, 2023
Merged

Conversation

zubaira
Copy link
Contributor

@zubaira zubaira commented Nov 30, 2023

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Merging #15802 (5bfa191) into master (ac87838) will increase coverage by 16.84%.
Report is 1 commits behind head on master.
The diff coverage is 0.00%.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #15802       +/-   ##
=============================================
+ Coverage     49.50%   66.34%   +16.84%     
- Complexity    23386    31441     +8055     
=============================================
  Files          3491     3491               
  Lines        130105   130106        +1     
  Branches      15192    15192               
=============================================
+ Hits          64403    86322    +21919     
+ Misses        59637    36705    -22932     
- Partials       6065     7079     +1014     
Flag Coverage Δ
integration 50.04% <0.00%> (?)
integration-h2 32.33% <0.00%> (-0.01%) ⬇️
unit 30.40% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...sp/dhis/webapi/controller/icon/IconController.java 30.00% <0.00%> (+27.95%) ⬆️

... and 1230 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

HttpServletResponse response, HttpServletRequest request, @PathVariable String iconKey)
throws IOException {
String location = response.encodeRedirectURL("/" + iconKey + "/icon");
response.sendRedirect(ContextUtils.getRootPath(request) + location);

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
@zubaira zubaira requested review from enricocolasante and a team December 4, 2023 07:41
public void getIconData(HttpServletResponse response, @PathVariable String iconKey)
throws IOException, NotFoundException {
downloadDefaultIcon(iconKey, response);
public void getIconData(
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also mark the endpoint as deprecated? or is it not necessary?

Copy link

sonarcloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@zubaira zubaira merged commit 485a832 into master Dec 5, 2023
16 checks passed
@zubaira zubaira deleted the DHIS2-16042 branch December 5, 2023 09:08
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.

3 participants