Skip to content

Commit

Permalink
Update metafix/src/main/java/org/metafacture/metafix/FixMethod.java
Browse files Browse the repository at this point in the history
Co-authored-by: Jens Wille <[email protected]>
  • Loading branch information
dr0i and blackwinter authored Nov 14, 2024
1 parent fd3967f commit e49cdd7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions metafix/src/main/java/org/metafacture/metafix/FixMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -681,12 +681,9 @@ public void apply(final Metafix metafix, final Record record, final List<String>
@Override
public void apply(final Metafix metafix, final Record record, final List<String> params, final Map<String, String> options) {
final boolean urlSafe = getBoolean(options, "url_safe");
if (!urlSafe) {
record.transform(params.get(0), s -> Base64.getEncoder().encodeToString(s.getBytes()));
}
else {
record.transform(params.get(0), s -> Base64.getUrlEncoder().encodeToString(s.getBytes()));
}
final Base64.Encoder encoder = urlSafe ? Base64.getUrlEncoder() : Base64.getEncoder();

record.transform(params.get(0), s -> encoder.encodeToString(s.getBytes()));
}
},
to_json {
Expand Down

0 comments on commit e49cdd7

Please sign in to comment.