Skip to content

Commit

Permalink
fix StaticBucketRouter refactor DefaultInboxActionsModule
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Sep 18, 2024
1 parent 400ee52 commit add30e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public abstract class DefaultInboxActionsModule {
/**
* By default, writes file into users' INBOX using his public key (no privatespace access required).
*/
@Provides
static String provideRootBucket() {
return "datasafe-root";
}

@Binds
abstract WriteToInbox writeInbox(WriteToInboxImplRuntimeDelegatable impl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public String resourceKey(AbsoluteLocation resource) {
UnaryOperator<String> trimStartingSlash = str -> str.replaceFirst("^/", "");

String resourcePath = trimStartingSlash.apply(resource.location().getRawPath());
if (bucketName == null || "".equals(bucketName) || !resourcePath.contains(bucketName)) {
if (bucketName == null || "".equals(bucketName) || !resourcePath.startsWith(bucketName)) {
return resourcePath;
}

return trimStartingSlash.apply(resourcePath.substring(resourcePath.indexOf(bucketName) + bucketName.length()));
return trimStartingSlash.apply(resourcePath.substring(bucketName.length()));
}
}

0 comments on commit add30e6

Please sign in to comment.