/** * Actual dispatch handling for servlet requests */ void executeRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Handling restful request for " + servletRequest.getPathInfo()); } setCharacterEncodings(servletRequest, servletResponse); SecurityToken token = getSecurityToken(servletRequest); if (token == null) { sendSecurityError(servletResponse); return; } HttpUtil.setCORSheader(servletResponse, containerConfig.<String>getList(token.getContainer(), "gadgets.parentOrigins")); handleSingleRequest(servletRequest, servletResponse, token); }
@Test @Ignore("HttpServletResponseRecorder doesn't support multiple headers") public void testCORSmultiple() { HttpUtil.setCORSheader(recorder, Arrays.asList("http://foo.example.com", "http://bar.example.com")); // TODO fix HttpServletResponseRecorder and add multi-header test here }
/** * Actual dispatch handling for servlet requests */ void executeRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Handling restful request for " + servletRequest.getPathInfo()); } setCharacterEncodings(servletRequest, servletResponse); SecurityToken token = getSecurityToken(servletRequest); if (token == null) { sendSecurityError(servletResponse); return; } HttpUtil.setCORSheader(servletResponse, containerConfig.<String>getList(token.getContainer(), "gadgets.parentOrigins")); handleSingleRequest(servletRequest, servletResponse, token); }
@Test @Ignore("HttpServletResponseRecorder doesn't support multiple headers") public void testCORSmultiple() { HttpUtil.setCORSheader(recorder, Arrays.asList("http://foo.example.com", "http://bar.example.com")); // TODO fix HttpServletResponseRecorder and add multi-header test here }
/** * Actual dispatch handling for servlet requests */ void executeRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Handling restful request for " + servletRequest.getPathInfo()); } setCharacterEncodings(servletRequest, servletResponse); SecurityToken token = getSecurityToken(servletRequest); if (token == null) { sendSecurityError(servletResponse); return; } HttpUtil.setCORSheader(servletResponse, containerConfig.<String>getList(token.getContainer(), "gadgets.parentOrigins")); handleSingleRequest(servletRequest, servletResponse, token); }
/** * Actual dispatch handling for servlet requests */ void executeRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Handling restful request for " + servletRequest.getPathInfo()); } setCharacterEncodings(servletRequest, servletResponse); SecurityToken token = getSecurityToken(servletRequest); if (token == null) { sendSecurityError(servletResponse); return; } HttpUtil.setCORSheader(servletResponse, containerConfig.<String>getList(token.getContainer(), "gadgets.parentOrigins")); BeanConverter converter = getConverterForRequest(servletRequest); handleSingleRequest(servletRequest, servletResponse, token, converter); }
@Test @Ignore("HttpServletResponseRecorder doesn't support multiple headers") public void testCORSmultiple() { HttpUtil.setCORSheader(recorder, Arrays.asList("http://foo.example.com", "http://bar.example.com")); // TODO fix HttpServletResponseRecorder and add multi-header test here }
/** * Actual dispatch handling for servlet requests */ void executeRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("Handling restful request for " + servletRequest.getPathInfo()); } setCharacterEncodings(servletRequest, servletResponse); SecurityToken token = getSecurityToken(servletRequest); if (token == null) { sendSecurityError(servletResponse); return; } HttpUtil.setCORSheader(servletResponse, containerConfig.<String>getList(token.getContainer(), "gadgets.parentOrigins")); BeanConverter converter = getConverterForRequest(servletRequest); handleSingleRequest(servletRequest, servletResponse, token, converter); }
@Test @Ignore("HttpServletResponseRecorder doesn't support multiple headers") public void testCORSmultiple() { HttpUtil.setCORSheader(recorder, Arrays.asList("http://foo.example.com", "http://bar.example.com")); // TODO fix HttpServletResponseRecorder and add multi-header test here }
@Test @Ignore("HttpServletResponseRecorder doesn't support multiple headers") public void testCORSmultiple() { HttpUtil.setCORSheader(recorder, Arrays.asList("http://foo.example.com", "http://bar.example.com")); // TODO fix HttpServletResponseRecorder and add multi-header test here }
@Test public void testCORSstar() { HttpUtil.setCORSheader(recorder, Collections.singleton("*")); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), "*"); }
@Test public void testCORSstar() { HttpUtil.setCORSheader(recorder, Collections.singleton("*")); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), "*"); }
@Test public void testCORSstar() { HttpUtil.setCORSheader(recorder, Collections.singleton("*")); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), "*"); }
@Test public void testCORSstar() { HttpUtil.setCORSheader(recorder, Collections.singleton("*")); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), "*"); }
@Test public void testCORSstar() { HttpUtil.setCORSheader(recorder, Collections.singleton("*")); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), "*"); }
@Test public void testCORSnull() { HttpUtil.setCORSheader(recorder, null); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), null); }
@Test public void testCORSnull() { HttpUtil.setCORSheader(recorder, null); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), null); }
@Test public void testCORSnull() { HttpUtil.setCORSheader(recorder, null); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), null); }
@Test public void testCORSnull() { HttpUtil.setCORSheader(recorder, null); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), null); }
@Test public void testCORSnull() { HttpUtil.setCORSheader(recorder, null); assertEquals(recorder.getHeader(HttpUtil.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER), null); }