fix: cors (again), isRt flag and build in POM
This commit is contained in:
@@ -3,6 +3,7 @@ package net.miarma.backend.mpaste.config;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
@Configuration
|
||||
@@ -10,8 +11,10 @@ public class NoSecurityConfig {
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.csrf(csrf -> csrf.disable())
|
||||
.authorizeHttpRequests(auth -> auth.anyRequest().permitAll());
|
||||
.cors(AbstractHttpConfigurer::disable)
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.authorizeHttpRequests(auth -> auth.anyRequest().permitAll());
|
||||
|
||||
return http.build();
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
registry.addEndpoint("/ws")
|
||||
.setAllowedOriginPatterns("*")
|
||||
.setAllowedOrigins("https://paste.miarma.net", "http://localhost:3000")
|
||||
.withSockJS();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PasteDto {
|
||||
this.syntax = syntax;
|
||||
}
|
||||
|
||||
public Boolean isBurnAfter() {
|
||||
public Boolean getIsBurnAfter() {
|
||||
return burnAfter;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PasteDto {
|
||||
this.burnAfter = burnAfter;
|
||||
}
|
||||
|
||||
public Boolean isPrivate() {
|
||||
public Boolean getIsPrivate() {
|
||||
return isPrivate;
|
||||
}
|
||||
|
||||
@@ -67,11 +67,11 @@ public class PasteDto {
|
||||
this.isPrivate = isPrivate;
|
||||
}
|
||||
|
||||
public Boolean isRt() {
|
||||
public Boolean getIsRt() {
|
||||
return isRt;
|
||||
}
|
||||
|
||||
public void setRt(Boolean rt) {
|
||||
public void setIsRt(Boolean rt) {
|
||||
isRt = rt;
|
||||
}
|
||||
|
||||
@@ -149,27 +149,27 @@ public class PasteDto {
|
||||
this.views = views;
|
||||
}
|
||||
|
||||
public Boolean isBurnAfter() {
|
||||
public Boolean getIsBurnAfter() {
|
||||
return burnAfter;
|
||||
}
|
||||
|
||||
public void setBurnAfter(Boolean burnAfter) {
|
||||
public void setIsBurnAfter(Boolean burnAfter) {
|
||||
this.burnAfter = burnAfter;
|
||||
}
|
||||
|
||||
public Boolean isPrivate() {
|
||||
public Boolean getIsPrivate() {
|
||||
return isPrivate;
|
||||
}
|
||||
|
||||
public void setPrivate(Boolean isPrivate) {
|
||||
public void setIsPrivate(Boolean isPrivate) {
|
||||
this.isPrivate = isPrivate;
|
||||
}
|
||||
|
||||
public Boolean isRt() {
|
||||
public Boolean getIsRt() {
|
||||
return isRt;
|
||||
}
|
||||
|
||||
public void setRt(Boolean rt) {
|
||||
public void setIsRt(Boolean rt) {
|
||||
isRt = rt;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ public final class PasteMapper {
|
||||
paste.setSyntax(request.getSyntax());
|
||||
paste.setPasteKey(request.getPasteKey());
|
||||
|
||||
paste.setBurnAfter(Boolean.TRUE.equals(request.isBurnAfter()));
|
||||
paste.setPrivate(Boolean.TRUE.equals(request.isPrivate()));
|
||||
paste.setRt(Boolean.TRUE.equals(request.isRt()));
|
||||
paste.setBurnAfter(Boolean.TRUE.equals(request.getIsBurnAfter()));
|
||||
paste.setPrivate(Boolean.TRUE.equals(request.getIsPrivate()));
|
||||
paste.setRt(Boolean.TRUE.equals(request.getIsRt()));
|
||||
|
||||
paste.setPassword(request.getPassword());
|
||||
|
||||
@@ -43,9 +43,9 @@ public final class PasteMapper {
|
||||
|
||||
response.setViews(paste.getViews());
|
||||
|
||||
response.setBurnAfter(paste.isBurnAfter());
|
||||
response.setPrivate(paste.isPrivate());
|
||||
response.setRt(paste.isRt());
|
||||
response.setIsBurnAfter(paste.isBurnAfter());
|
||||
response.setIsPrivate(paste.isPrivate());
|
||||
response.setIsRt(paste.isRt());
|
||||
|
||||
response.setCreatedAt(paste.getCreatedAt());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user