Skip to content

Commit 64fc7b0

Browse files
authored
Merge pull request #220 from georchestra/fix-import-stylesheet-in-error-pages
feat: Dumb flo, there was already an easier method...
2 parents a46f56e + 76f211d commit 64fc7b0

File tree

2 files changed

+9
-72
lines changed

2 files changed

+9
-72
lines changed

gateway/src/main/java/org/georchestra/gateway/app/ErrorControllerAdvice.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

gateway/src/main/java/org/georchestra/gateway/autoconfigure/app/CustomErrorAttributes.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.net.UnknownHostException;
2323
import java.util.Map;
2424

25+
import org.springframework.beans.factory.annotation.Value;
2526
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
2627
import org.springframework.boot.web.error.ErrorAttributeOptions;
2728
import org.springframework.boot.web.reactive.error.DefaultErrorAttributes;
@@ -63,6 +64,12 @@
6364
*/
6465
public class CustomErrorAttributes extends DefaultErrorAttributes {
6566

67+
/** Path to the geOrchestra custom stylesheet, if configured. */
68+
private @Value("${georchestraStylesheet:}") String georchestraStylesheet;
69+
70+
/** URL of the logo displayed in the header. */
71+
private @Value("${logoUrl:}") String logoUrl;
72+
6673
/**
6774
* Overrides the default error attributes to remap specific exceptions to
6875
* appropriate HTTP status codes.
@@ -104,6 +111,8 @@ public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttrib
104111
attributes.put("status", HttpStatus.FORBIDDEN.value());
105112
attributes.put("error", HttpStatus.FORBIDDEN.getReasonPhrase());
106113
}
114+
attributes.put("georchestraStylesheet", georchestraStylesheet);
115+
attributes.put("logoUrl", logoUrl);
107116

108117
return attributes;
109118
}

0 commit comments

Comments
 (0)