Skip to content
Browse files

revert back to original behavior with note

  • Loading branch information...
1 parent acf8fe6 commit cc12040fad17fa668d834e393ee49fb58a23b0a2 @jdillon jdillon committed
View
60 .../java/org/sonatype/nexus/security/filter/authz/NexusTargetMappingAuthorizationFilter.java
@@ -60,38 +60,34 @@ public String getResourceStorePath( ServletRequest request )
{
String path = WebUtils.getPathWithinApplication( (HttpServletRequest) request );
- // HACK: Disable so that NX can serve resources, not sure why this is failing
-
- //System.out.println("PATH: " + path);
- //
- //if ( getPathPrefix() != null )
- //{
- // System.out.println("PATTERN: " + getPathPrefixPattern());
- //
- // Matcher m = this.getPathPrefixPattern().matcher( path );
- //
- // if ( m.matches() )
- // {
- // path = getPathReplacement();
- //
- // // TODO: hardcoded currently
- // if ( path.contains( "@1" ) )
- // {
- // path = path.replaceAll( "@1", Matcher.quoteReplacement( m.group( 1 ) ) );
- // }
- //
- // if ( path.contains( "@2" ) )
- // {
- // path = path.replaceAll( "@2", Matcher.quoteReplacement( m.group( 2 ) ) );
- // }
- // // and so on... this will be reworked to be dynamic
- // }
- // else
- // {
- // throw new IllegalArgumentException(
- // "The request path does not matches the incoming request? This is misconfiguration in web.xml!" );
- // }
- //}
+ // FIXME: This is having issues... causing the UI to be non-functional, perhaps revisit post move of core rest into plugin?
+
+ if ( getPathPrefix() != null )
+ {
+ Matcher m = this.getPathPrefixPattern().matcher( path );
+
+ if ( m.matches() )
+ {
+ path = getPathReplacement();
+
+ // TODO: hardcoded currently
+ if ( path.contains( "@1" ) )
+ {
+ path = path.replaceAll( "@1", Matcher.quoteReplacement( m.group( 1 ) ) );
+ }
+
+ if ( path.contains( "@2" ) )
+ {
+ path = path.replaceAll( "@2", Matcher.quoteReplacement( m.group( 2 ) ) );
+ }
+ // and so on... this will be reworked to be dynamic
+ }
+ else
+ {
+ throw new IllegalArgumentException(
+ "The request path does not matches the incoming request? This is misconfiguration in web.xml!" );
+ }
+ }
return path;
}

0 comments on commit cc12040

Please sign in to comment.
Something went wrong with that request. Please try again.