Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 410157 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushServiceHandler.java (-1 / +11 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2012 Innoopract Informationssysteme GmbH and others.
2
 * Copyright (c) 2007, 2013 Innoopract Informationssysteme GmbH and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 26-32 Link Here
26
  public void service( HttpServletRequest request, HttpServletResponse response )
26
  public void service( HttpServletRequest request, HttpServletResponse response )
27
    throws IOException
27
    throws IOException
28
  {
28
  {
29
    setResponseHeaders( response );
29
    ServerPushManager.getInstance().processRequest( response );
30
    ServerPushManager.getInstance().processRequest( response );
30
  }
31
  }
31
32
33
  private static void setResponseHeaders( HttpServletResponse response ) {
34
    // Ensures that the response is not cached
35
    // 410157: [ServerPush] ServerPush requests always return immediately in IE
36
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=410157
37
    response.setHeader( "Cache-Control", "no-cache, no-store, must-revalidate" );
38
    response.setHeader( "Pragma", "no-cache" );
39
    response.setDateHeader( "Expires", 0 );
40
  }
41
32
}
42
}
(-)a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/serverpush/ServerPushManager_Test.java (+11 lines)
Lines 516-521 Link Here
516
    }
516
    }
517
  }
517
  }
518
518
519
  @Test
520
  public void testResponseHeaders() throws IOException {
521
    TestResponse response = ( TestResponse )ContextProvider.getResponse();
522
523
    pushServiceHandler.service( ContextProvider.getRequest(), response );
524
525
    assertNotNull( response.getHeader( "Cache-Control" ) );
526
    assertNotNull( response.getHeader( "Pragma" ) );
527
    assertNotNull( response.getHeader( "Expires" ) );
528
  }
529
519
  private void simulateBackgroundAddition( final ServiceContext serviceContext ) throws Throwable {
530
  private void simulateBackgroundAddition( final ServiceContext serviceContext ) throws Throwable {
520
    Runnable runnable = new Runnable() {
531
    Runnable runnable = new Runnable() {
521
      public void run() {
532
      public void run() {
(-)a/tests/org.eclipse.rap.rwt.testfixture/src/org/eclipse/rap/rwt/testfixture/TestResponse.java (-3 / +13 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2009, 2012 EclipseSource and others.
2
 * Copyright (c) 2009, 2013 EclipseSource and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-17 Link Here
10
 ******************************************************************************/
10
 ******************************************************************************/
11
package org.eclipse.rap.rwt.testfixture;
11
package org.eclipse.rap.rwt.testfixture;
12
12
13
import java.io.*;
13
import java.io.ByteArrayOutputStream;
14
import java.util.*;
14
import java.io.IOException;
15
import java.io.OutputStreamWriter;
16
import java.io.PrintWriter;
17
import java.io.UnsupportedEncodingException;
18
import java.util.Collection;
19
import java.util.Date;
20
import java.util.HashMap;
21
import java.util.Locale;
22
import java.util.Map;
15
23
16
import javax.servlet.ServletOutputStream;
24
import javax.servlet.ServletOutputStream;
17
import javax.servlet.http.Cookie;
25
import javax.servlet.http.Cookie;
Lines 97-105 Link Here
97
  }
105
  }
98
106
99
  public void setDateHeader( String arg0, long arg1 ) {
107
  public void setDateHeader( String arg0, long arg1 ) {
108
    headers.put( arg0, new Date( arg1 ).toString() );
100
  }
109
  }
101
110
102
  public void addDateHeader( String arg0, long arg1 ) {
111
  public void addDateHeader( String arg0, long arg1 ) {
112
    headers.put( arg0, new Date( arg1 ).toString() );
103
  }
113
  }
104
114
105
  public void setHeader( String arg0, String arg1 ) {
115
  public void setHeader( String arg0, String arg1 ) {

Return to bug 410157