You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/05/28 21:51:38 UTC

[Bug 56573] New: [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

            Bug ID: 56573
           Summary: [Spec?] Session.getRequestURI() doesn't return the
                    protocol, port etc.
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
                OS: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: jfarcand@apache.org

The spec is unclear about it, but 

    Session.getRequestURI();

doesn't return the full path, e.g for an enpoint, it returns

   /atmosphere-chat

"instead" of 

   ws://host:port/atmosphere-chat

The issue I'm facing is an application cannot rebuidl the full URL as the port
is missing, and there are no way to find the port without the proper URI.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #7 from Mark Thomas <ma...@apache.org> ---
I've received reports that this change triggers a TCK failure. I'll therefore
be reverting this change.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
(In reply to Konstantin Kolinko from comment #4)
> The WebSocket method is clearly documented to include a query string

I went looking for that and couldn't find it. I'll add the query string back
in.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
Done.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #8 from Mark Thomas <ma...@apache.org> ---
The current behavior is required by the TCK.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
One to raise with the EG for clarification.

As an aside, why does an application need to rebuild the full URL?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
I've switched this to the full uncoded path minus the query string (i.e. the
result of HttpServletRequest.getRequestURL()) but with ws/wss as the scheme
rather than http/https. Note that this might change again once/if the EG issues
some clarification.

This has been fixed in 8.0.x for 8.0.9 onwards and in 7.0.x for 7.0.55

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

--- Comment #4 from Konstantin Kolinko <kn...@gmail.com> ---
HttpServletRequest.getRequestURI():
http://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getRequestURI%28%29

Session.getRequestURI()
http://docs.oracle.com/javaee/7/api/javax/websocket/Session.html#getRequestURI%28%29

The WebSocket method is clearly documented to include a query string (as
opposed to HttpServletRequest method). It also returns an URI, not a String.
These are different methods.

Personally, it is not clear to me from WebSocket documentation whether this
method includes a contextPath, not saying about protocol, server name and port.
It is also not clear whether it is "decoded" or non-decoded path (see Servlet
API method), but as it is an URI maybe it does not matter.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 56573] [Spec?] Session.getRequestURI() doesn't return the protocol, port etc.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56573

--- Comment #2 from Jean-Francois Arcand <jf...@apache.org> ---
For tracking purpose

https://java.net/jira/browse/WEBSOCKET_SPEC-228

Atmosphere can dispatch a WebSocket Message into a normal HttpServletRequest so
an application transparently use WebSocket under the hood. This is the use
case. For example, RestEasy is broken because of the "issue", but will
workaround it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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