Skip to content

Commit

Permalink
HDFS-17753. Fix occasional failure of TestRouterHttpServerXFrame. (#7467
Browse files Browse the repository at this point in the history
) Contributed by farmmamba.

HDFS-17753. Fix occasional failure of TestRouterHttpServerXFrame.

Reviewed-by: Ayush Saxena <[email protected]>
Signed-off-by: Shilun Fan <[email protected]>
  • Loading branch information
hfutatzhanghb authored Mar 6, 2025
1 parent d552bb0 commit f0430f2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import java.net.URI;
import java.net.URL;

import org.apache.hadoop.hdfs.server.federation.RouterConfigBuilder;
import org.junit.Assert;
import org.junit.Test;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.HdfsConfiguration;

import static org.apache.hadoop.http.HttpServer2.XFrameOption.SAMEORIGIN;

Expand All @@ -39,7 +39,9 @@ public class TestRouterHttpServerXFrame {

@Test
public void testRouterXFrame() throws IOException {
Configuration conf = new HdfsConfiguration();
Configuration conf = new RouterConfigBuilder()
.http()
.build();
conf.setBoolean(DFSConfigKeys.DFS_XFRAME_OPTION_ENABLED, true);
conf.set(DFSConfigKeys.DFS_XFRAME_OPTION_VALUE, SAMEORIGIN.toString());

Expand Down

0 comments on commit f0430f2

Please sign in to comment.