Skip to content
Tcl Source Code History Of Ticket 5f923c60b2
Login

History Of Ticket 5f923c60b2

Artifacts Associated With Ticket 5f923c60b2

  1. Ticket change [ff0c39d0d5] (rid 141874) by anonymous on 2015-05-19 15:33:06:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      ::http::geturl doesn't accept this url:
      http://127.0.0.1:33543/hub/session/fedc2754-770e-4b3a-9c1e-2fb16d0e0eaf/element/{56dcfe8e-c512-4dbf-a37a-4dbfb6d14b98}/value
      
      I suppose the reason is these characters: "{", "}"
      
      I am developing a selenium library in TCL. And this kind of url's are common. Python automatically converts these illegal characters in path to hexadecimal.
      
      I think that ::http::geturl should also convert all illegal characters in the path.
      
    5. foundin initialized to: "8.6"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "1c4b6cdb98c9dfc4d1e74018f3f4efa00ad217e2"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "29. http Package"
    15. title initialized to: "Bug in library http. Illegal characters in path"
    16. type initialized to: "Bug"
  2. Ticket change [e96f15395f] (rid 162357) by kjnash on 2018-04-13 15:08:54:

    1. icomment:
      There are corner cases that would make this conversion a little awkward - for example if a user has edited a URL in the address bar and added illegal characters, should the command conclude that the entire URL needs conversion and convert any existing "%" again?  What if an existing "%" is not followed by a valid hexadecimal code? Should "+" be considered a valid conversion of the space character, or should it be converted to "%2B"?  I wonder how the Python library resolves problems like this.
      
      The command http::geturl expects a valid URL. However, the http library could provide commands to encode a URL before passing it to http::geturl.
      
      In the meantime, if you know that the URL path needs encoding, the following code will do it:
      
      package require http
      package require uri
      
      proc urlEncodePath {url} {
          set splits [uri::split $url]
          set encPathList {}
          set path [dict get $splits path]
          set pathList [split $path /]
          foreach el $pathList {
              lappend encPathList [http::mapReply $el]
          }
          set path [join $encPathList /]
          dict set splits path $path
          uri::join {*}$splits
      }
      
      set url http://127.0.0.1:33543/hub/session/fedc2754-770e-4b3a-9c1e-2fb16d0e0eaf/element/{56dcfe8e-c512-4dbf-a37a-4dbfb6d14b98}/value
      
      urlEncodePath $url
      
      - returns -
      
      http://127.0.0.1:33543/hub/session/fedc2754-770e-4b3a-9c1e-2fb16d0e0eaf/element/%7B56dcfe8e-c512-4dbf-a37a-4dbfb6d14b98%7D/value
      
    2. login: "kjnash"
    3. mimetype: "text/plain"
  3. Ticket change [61b1fafbe0] (rid 190580) by kjnash on 2020-12-31 15:15:54:

    1. login: "kjnash"
    2. mimetype: "text/plain"
    3. title changed to: "URL-Encoding of invalid characters in URL"
    4. type changed to: "RFE"