/** * Disables frame options response header * @return the {@link HeaderSpec} to continue configuring */ public HeaderSpec disable() { HeaderSpec.this.writers.remove(HeaderSpec.this.frameOptions); return and(); }
@Test public void headersWhenFrameOptionsModeThenFrameOptionsCustomMode() { this.expectedHeaders.set(XFrameOptionsServerHttpHeadersWriter.X_FRAME_OPTIONS, "SAMEORIGIN"); this.headers .frameOptions() .mode(XFrameOptionsServerHttpHeadersWriter.Mode.SAMEORIGIN); assertHeaders(); }
/** * Disables frame options response header * @return the {@link HeaderSpec} to continue configuring */ public HeaderSpec disable() { HeaderSpec.this.writers.remove(HeaderSpec.this.frameOptions); return and(); }
/** * The mode to configure. Default is * {@link org.springframework.security.web.server.header.XFrameOptionsServerHttpHeadersWriter.Mode#DENY} * @param mode the mode to use * @return the {@link HeaderSpec} to configure */ public HeaderSpec mode(XFrameOptionsServerHttpHeadersWriter.Mode mode) { HeaderSpec.this.frameOptions.setMode(mode); return and(); }
/** * Configures frame options response headers * @return the {@link FrameOptionsSpec} to configure */ public FrameOptionsSpec frameOptions() { return new FrameOptionsSpec(); }
/** * The mode to configure. Default is * {@link org.springframework.security.web.server.header.XFrameOptionsServerHttpHeadersWriter.Mode#DENY} * @param mode the mode to use * @return the {@link HeaderSpec} to configure */ public HeaderSpec mode(XFrameOptionsServerHttpHeadersWriter.Mode mode) { HeaderSpec.this.frameOptions.setMode(mode); return and(); }
/** * Disables frame options response header * @return the {@link HeaderSpec} to continue configuring */ public HeaderSpec disable() { HeaderSpec.this.writers.remove(HeaderSpec.this.frameOptions); return and(); }
/** * Configures frame options response headers * @return the {@link FrameOptionsSpec} to configure */ public FrameOptionsSpec frameOptions() { return new FrameOptionsSpec(); }
/** * The mode to configure. Default is * {@link org.springframework.security.web.server.header.XFrameOptionsServerHttpHeadersWriter.Mode#DENY} * @param mode the mode to use * @return the {@link HeaderSpec} to configure */ public HeaderSpec mode(XFrameOptionsServerHttpHeadersWriter.Mode mode) { HeaderSpec.this.frameOptions.setMode(mode); return and(); }
@Test public void headersWhenFrameOptionsDisableThenFrameOptionsNotWritten() { expectHeaderNamesNotPresent(XFrameOptionsServerHttpHeadersWriter.X_FRAME_OPTIONS); this.headers.frameOptions().disable(); assertHeaders(); }
/** * Configures frame options response headers * @return the {@link FrameOptionsSpec} to configure */ public FrameOptionsSpec frameOptions() { return new FrameOptionsSpec(); }