You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/12/27 19:08:15 UTC

svn commit: r1426279 - in /tomcat/trunk/java: javax/websocket/server/DefaultServerConfiguration.java javax/websocket/server/ServerEndpointConfiguration.java org/apache/tomcat/websocket/PojoEndpointConfiguration.java

Author: markt
Date: Thu Dec 27 18:08:14 2012
New Revision: 1426279

URL: http://svn.apache.org/viewvc?rev=1426279&view=rev
Log:
Javadoc and remove unnecessary code

Modified:
    tomcat/trunk/java/javax/websocket/server/DefaultServerConfiguration.java
    tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java
    tomcat/trunk/java/org/apache/tomcat/websocket/PojoEndpointConfiguration.java

Modified: tomcat/trunk/java/javax/websocket/server/DefaultServerConfiguration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/server/DefaultServerConfiguration.java?rev=1426279&r1=1426278&r2=1426279&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/server/DefaultServerConfiguration.java (original)
+++ tomcat/trunk/java/javax/websocket/server/DefaultServerConfiguration.java Thu Dec 27 18:08:14 2012
@@ -26,6 +26,9 @@ import javax.websocket.Endpoint;
 import javax.websocket.Extension;
 import javax.websocket.HandshakeResponse;
 
+/**
+ * Provides the default implementation for WebSocket server endpoints.
+ */
 public class DefaultServerConfiguration implements ServerEndpointConfiguration {
 
     private Class<? extends Endpoint> endpointClass;
@@ -101,6 +104,11 @@ public class DefaultServerConfiguration 
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     *
+     * The default implementation accepts all connection requests.
+     */
     @Override
     public boolean checkOrigin(String originHeaderValue) {
         return true;

Modified: tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java?rev=1426279&r1=1426278&r2=1426279&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java (original)
+++ tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java Thu Dec 27 18:08:14 2012
@@ -32,11 +32,24 @@ public interface ServerEndpointConfigura
 
     List<Extension> getNegotiatedExtensions(List<Extension> requestedExtensions);
 
+    /**
+     * Enables the WebSocket endpoint to acceot or reject connections based on
+     * the HTTP origin header.
+     *
+     * @param originHeaderValue The HTTP origin header provided by the client.
+     *
+     * @return  <code>true</code> if the request should be accepted otherwise
+     *          <code>false</false>
+     */
     boolean checkOrigin(String originHeaderValue);
 
     boolean matchesURI(URI uri);
 
     void modifyHandshake(HandshakeRequest request, HandshakeResponse response);
 
+    /**
+     * Returns the path at which this WebSocket server endpoint has been
+     * registered. It may be a path or a level 0 URI template.
+     */
     String getPath();
 }

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/PojoEndpointConfiguration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/PojoEndpointConfiguration.java?rev=1426279&r1=1426278&r2=1426279&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/PojoEndpointConfiguration.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/PojoEndpointConfiguration.java Thu Dec 27 18:08:14 2012
@@ -44,13 +44,6 @@ public class PojoEndpointConfiguration e
 
 
     @Override
-    public boolean checkOrigin(String originHeaderValue) {
-        // Allow all
-        return true;
-    }
-
-
-    @Override
     public String getPath() {
         return servletPath;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1426279 - in /tomcat/trunk/java: javax/websocket/server/DefaultServerConfiguration.java javax/websocket/server/ServerEndpointConfiguration.java org/apache/tomcat/websocket/PojoEndpointConfiguration.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/12/27  <ma...@apache.org>:
> Author: markt
> Date: Thu Dec 27 18:08:14 2012
> New Revision: 1426279
>
> URL: http://svn.apache.org/viewvc?rev=1426279&view=rev
> Log:
> Javadoc and remove unnecessary code
>
> Modified:
>     tomcat/trunk/java/javax/websocket/server/DefaultServerConfiguration.java
>     tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java
>     tomcat/trunk/java/org/apache/tomcat/websocket/PojoEndpointConfiguration.java
>

> --- tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java (original)
> +++ tomcat/trunk/java/javax/websocket/server/ServerEndpointConfiguration.java Thu Dec 27 18:08:14 2012
> @@ -32,11 +32,24 @@ public interface ServerEndpointConfigura
>
>      List<Extension> getNegotiatedExtensions(List<Extension> requestedExtensions);
>
> +    /**
> +     * Enables the WebSocket endpoint to acceot or reject connections based on

(fixed a typo)

> +     * the HTTP origin header.

"the HTTP origin header" is understandable, but sounds as if the order
of adjectives is wrong.

Maybe " the "Origin" HTTP header " ?

Speaking of which, the "Origin" header is not defined by RFC2616
(HTTP/1.1), but by its own RFC6454 (The Web Origin Concept).

http://tools.ietf.org/html/rfc6454

> +     *
> +     * @param originHeaderValue The HTTP origin header provided by the client.
> +     *
> +     * @return  <code>true</code> if the request should be accepted otherwise
> +     *          <code>false</false>
> +     */
>      boolean checkOrigin(String originHeaderValue);
>
>      boolean matchesURI(URI uri);
>
>      void modifyHandshake(HandshakeRequest request, HandshakeResponse response);
>
> +    /**
> +     * Returns the path at which this WebSocket server endpoint has been
> +     * registered. It may be a path or a level 0 URI template.

What is "level 0" here?

(A quick googling found
http://tools.ietf.org/html/rfc6570#section-1.2
which should be right as that RFC is mentioned by JSR356,
but numbering there starts with Level 1. Where does "Level 0" come from?).

> +     */
>      String getPath();
>  }
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org