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

[GWC-1171] Improve handling special characters in the GWC Demos Page #1173

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

sikeoka
Copy link
Contributor

@sikeoka sikeoka commented Oct 10, 2023

#1171
This PR updates the GWC Demos Page to properly escape special characters from GeoServer catalog information. One thing to note here is that StringEscapeUtils::escapeEcmaScript is not secure when used in HTML attributes so the OWASP Encoder library is used instead.

Copy link
Member

@aaime aaime left a comment

Choose a reason for hiding this comment

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

Looks overall good, one QA failure.

import org.springframework.util.Assert;

public class Demo {

@SuppressWarnings("PMD.AvoidPrintStackTrace")
Copy link
Member

Choose a reason for hiding this comment

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

Causes QA failure:

06:26:04,481 [INFO] PMD Failure: org.geowebcache.demo.Demo:103 Rule:AvoidPrintStackTrace Priority:3 Avoid printStackTrace(); use a logger call instead..
06:26:04,485 [INFO] PMD Failure: org.geowebcache.demo.Demo:103 Rule:AvoidPrintStackTrace Priority:3 Avoid printStackTrace(); use a logger call instead..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@sikeoka
Copy link
Contributor Author

sikeoka commented Oct 16, 2023

There was a Java heap space error in the downstream build.

@aaime aaime merged commit 3cb2fcc into GeoWebCache:main Nov 6, 2023
6 checks passed
@aaime
Copy link
Member

aaime commented Nov 6, 2023

The backport to 1.23.x failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 49b26ff7... [GWC-1171] Improve handling special characters in the GWC Demos Page
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

stdout
Auto-merging geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java
CONFLICT (content): Merge conflict in geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.23.x 1.23.x
# Navigate to the new working tree
cd .worktrees/backport-1.23.x
# Create a new branch
git switch --create backport-1173-to-1.23.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 49b26ff7b0b49113d1e0ed3f45ffc52b094934eb
# Push it to GitHub
git push --set-upstream origin backport-1173-to-1.23.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.23.x

Then, create a pull request where the base branch is 1.23.x and the compare/head branch is backport-1173-to-1.23.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants