mirror of https://github.com/halo-dev/halo
				
				
				
			Set mode of frame options to SAMEORIGIN (#2761)
#### What type of PR is this? /kind bug /area core #### What this PR does / why we need it: The problem https://github.com/halo-dev/halo/issues/2743 was introduced by https://github.com/halo-dev/halo/pull/2729. This Pr mainly resolves it by setting SAMEORIGIN mode for frame options.  #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2743 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note None ```pull/2762/head^2
							parent
							
								
									61c7459ccf
								
							
						
					
					
						commit
						12fd77f61f
					
				|  | @ -1,6 +1,7 @@ | |||
| package run.halo.app.config; | ||||
| 
 | ||||
| import static org.springframework.security.config.Customizer.withDefaults; | ||||
| import static org.springframework.security.web.server.header.XFrameOptionsServerHttpHeadersWriter.Mode.SAMEORIGIN; | ||||
| 
 | ||||
| import com.nimbusds.jose.JWSAlgorithm; | ||||
| import com.nimbusds.jose.jwk.JWKSet; | ||||
|  | @ -60,6 +61,9 @@ public class WebServerSecurityConfig { | |||
|             .access(new RequestInfoAuthorizationManager(roleService)) | ||||
|             .pathMatchers("/**").permitAll() | ||||
|             .and() | ||||
|             .headers() | ||||
|             .frameOptions().mode(SAMEORIGIN) | ||||
|             .and() | ||||
|             .anonymous(anonymousSpec -> { | ||||
|                 anonymousSpec.authorities(AnonymousUserConst.Role); | ||||
|                 anonymousSpec.principal(AnonymousUserConst.PRINCIPAL); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 John Niang
						John Niang