Skip to content

Commit

Permalink
Fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ztaylor54 committed Mar 5, 2021
1 parent 88f6b85 commit baf1ae4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cws-service/src/main/java/jpl/cws/controller/MvcService.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ public ModelAndView logintotarget(
.singleResult();
log.debug("user: " + user);

String pattern = // first part: some/relative/path
"^" // Anchor at the beginning of the string
+ "(?!\\/)" // Assert the first character isn't a '/' (negative lookahead)
+ "(?!.*\\/\\/)" // Assert there are no "//" present anywhere (negative lookahead)
+ "[A-Za-z0-9-\\/]+" // Match one or more allowed characters
+ "(?<!\\/)" // Assert the last character isn't a '/'
// second part: ?key=value
+ "(\\?" // Match '?' (start capture group 1)
+ "[A-Za-z0-9-]+=[A-Za-z0-9-]+" // Match key=value format one or more times
String pattern = // first part: some/relative/path
"^" // Anchor at the beginning of the string
+ "(?!\\/)" // Assert the first character isn't a '/' (negative lookahead)
+ "(?!.*\\/\\/)" // Assert there are no "//" present anywhere (negative lookahead)
+ "[A-Za-z0-9-\\/]+" // Match one or more allowed characters
+ "(?<!\\/)" // Assert the last character isn't a '/'
// second part: ?key=value
+ "(\\?" // Match '?' (start capture group 1)
+ "[A-Za-z0-9-]+=[A-Za-z0-9-]+" // Match key=value format one or more times
+ "(&[A-Za-z0-9-]+=[A-Za-z0-9-]+)*" // Followed by &key=value zero or more times
+ "){0,1}" // Match capture group 1 zero or 1 times
+ "$"; // Anchor at the end of the string
+ "){0,1}" // Match capture group 1 zero or 1 times
+ "$"; // Anchor at the end of the string

// if target page is not null, then redirect to target page
//
Expand Down

0 comments on commit baf1ae4

Please sign in to comment.