abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r510085 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/MethodOverrideFilter.java
Date Wed, 21 Feb 2007 16:27:17 GMT
Author: jmsnell
Date: Wed Feb 21 08:27:16 2007
New Revision: 510085

URL: http://svn.apache.org/viewvc?view=rev&rev=510085
Log:
Although the GData documentation uses the header "X-HTTP-Method-Override", some client implementations
have used
"X-Method-Override".  For the sake of being lenient, let's check for X-Method-Override if
X-HTTP-Method-Override
has not been set.

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/MethodOverrideFilter.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/MethodOverrideFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/MethodOverrideFilter.java?view=diff&rev=510085&r1=510084&r2=510085
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/MethodOverrideFilter.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/MethodOverrideFilter.java
Wed Feb 21 08:27:16 2007
@@ -54,7 +54,7 @@
         response);
     
     HttpServletResponse hresponse = (HttpServletResponse) response;
-    hresponse.addHeader("Vary", "X-HTTP-Method-Override");
+    hresponse.addHeader("Vary", "X-HTTP-Method-Override, X-Method-Override");
   }
 
   public void init(FilterConfig config) throws ServletException {
@@ -81,10 +81,12 @@
     public String getMethod() {
       String method = super.getMethod();
       String xheader = getHeader("X-HTTP-Method-Override");
+      if (xheader == null) xheader = getHeader("X-Method-Override");
+      if (xheader != null) xheader = xheader.toUpperCase().trim();
       if (method.equals("POST") && 
           xheader != null && 
           METHODS_TO_OVERRIDE.contains(xheader)) {
-        method = xheader.trim();
+        method = xheader;
       }
       return method;
     }



Mime
View raw message