Skip to content

Commit 2ed403b

Browse files
committed
fixes
Signed-off-by: Kirill Mokevnin <[email protected]>
1 parent d46e4c4 commit 2ed403b

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/main/java/io/hexlet/blog/config/SecurityConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ public class SecurityConfig {
1212

1313
@Bean
1414
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
15-
// Customize as needed; minimal chain without deprecated APIs
15+
http.authorizeHttpRequests(
16+
auth -> auth.requestMatchers("/", "/about", "/error", "/favicon.ico", "/css/**", "/js/**", "/images/**")
17+
.permitAll().anyRequest().authenticated())
18+
.csrf(csrf -> csrf.disable());
1619
return http.build();
1720
}
1821
}

src/main/java/io/hexlet/blog/controller/HelloController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
import org.springframework.web.bind.annotation.GetMapping;
44
import org.springframework.web.bind.annotation.RestController;
5+
import org.springframework.web.servlet.view.RedirectView;
56

67
@RestController
78
public class HelloController {
89
@GetMapping("/about")
910
public String index() {
1011
return "A boilerplate created by Hexlet";
1112
}
13+
@GetMapping("/")
14+
public RedirectView root() {
15+
return new RedirectView("/about");
16+
}
1217
}

src/main/resources/application.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
logging:
33
level:
44
root: WARN
5+
org.springframework.boot: INFO
56
org:
67
zalando:
78
logbook: TRACE
@@ -16,6 +17,9 @@ spring:
1617
output:
1718
ansi:
1819
enabled: always
20+
config:
21+
activate:
22+
on-profile: dev
1923

2024
sentry:
2125
dsn: https://[email protected]/0

0 commit comments

Comments
 (0)