Skip to content

Commit

Permalink
Merge pull request #1136 from scireum/feature/jvo/SIRI-597-Aggro-Base64
Browse files Browse the repository at this point in the history
Error Check in Base64 Macro (SIRI-597)
  • Loading branch information
jakobvogel authored Dec 2, 2022
2 parents a996fb2 + 1580e0c commit e303856
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
<exclusions>
<exclusion>
<groupId>com.github.jai-imageio</groupId>
Expand Down Expand Up @@ -153,7 +153,7 @@
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.4</version>
<version>2.2.6</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ public Object invoke(Environment environment, Object[] args) {

@Nonnull
private String encodeResource(String path) {
if (!path.startsWith("/assets")) {
if (!path.startsWith("/assets/")) {
throw new IllegalArgumentException("Only assets can be inlined for security reasons.");
}

Resource resource = resources.resolve(path).orElse(null);
if (resource == null) {
return "";
}
Resource resource =
resources.resolve(path).orElseThrow(() -> new IllegalArgumentException("Unknown resource: " + path));

String base64Data = Base64.getEncoder().encodeToString(resource.getContent());

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/sirius/web/dispatch/SiriusSassGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import java.io.InputStream;
import java.util.Optional;

/*
* Subclass of generator which takes care of proper logging
/**
* Subclass of {@link Generator} which takes care of proper logging.
*/
class SiriusSassGenerator extends Generator {

Expand Down

0 comments on commit e303856

Please sign in to comment.