websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-194

Clarify what is a valid WebSocket path spec syntax

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      As brought up in jsr356-experts:
      http://java.net/projects/websocket-spec/lists/jsr356-experts/archive/2013-04/message/6

      What would be a valid websocket path spec syntax?

      Some examples of GOOD path specs:

      "/bookings/

      {guest-id}

      " - section 4.1.1 and 4.3
      "/rewards/

      {vip-level}

      " - section 4.3
      "/hello" - section 2.1.4
      "/a/b/"
      "/a/

      {foo}

      "
      "/

      {bar}"
      "/{bar}

      /b/c"
      "/a/

      {var}/c"
      "/a/b/c"
      "/a/{var1}/{var2}"
      "/{var1}/d"
      "/b/{var2}"

      Some examples of BAD path specs:

      "/a/b{var}

      " - variable does not encompass whole path segment
      "a/

      {var}" - no start slash
      "/a/{var/b}" - path segment separator in variable name
      "/{var}

      /*" - no globs allowed
      "/

      {var}.do" - variable does not encompass whole path segment
      "/a/{var*}" - use of glob character not allowed in variable name.
      "/a/{}" - no variable name declared
      "/a/{---}" - no alpha character in variable name declared
      "{var}

      " - no start slash
      "/a/

      {my special variable}

      " - bad syntax for variable name, spaces used
      "/a/

      {var}/{var}

      " - duplicate variables (case sensitive)
      "/a/

      {var}/{Var}/{vAR}" - duplicate variables (case insensitive)
      "/a/../../{var}

      " - path navigation
      "/a/./

      {var}" - path navigation
      "/a//{var}

      " - empty path segment

      There are a number of things that could be better defined for valid path specs.
      Here's an example of some of the rules.

      1) Path Specs must start with "/" character
      2) A "path segment" is all characters between separators "/"
      3) A single path segment must be either a literal set of characters or a path param variable, but not both.
      4) A path segment cannot use the characters '

      {', '}

      ', '/', or '*'
      5) path navigation sequences "/../", "/./", and "//" cannot be used
      6) Variable names must conform to the established variable name syntax ( see WEBSOCKET_SPEC-193 )
      7) Duplicate variables names are not allowed to be present in path spec
      8) Variable names are case-insensitive

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            joakimerdfelt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: