Skip to content
Tcl Source Code History Of Ticket 3612478fffffffff
Login

History Of Ticket 3612478fffffffff

Artifacts Associated With Ticket 3612478fffffffff

  1. Ticket change [22676a1419] (rid 130744) by oehhar on 2013-05-02 11:35:53:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      IMHO it would be helpful, if http::geturl would follow redirects automatically (or with an option).
      
      Following http://wiki.tcl.tk/1475
      
      Thus 
      ::http::geturl $url -followredirect 1
      would do:
      proc geturl_followRedirects {url args} {
           while {1} {
              set token [eval [list http::geturl $url] $args]
              switch -glob [http::ncode $token] {
                 30[1237] { ### redirect - see below ### }
                 default  { return $token }
              }
              upvar #0 $token state
              array set meta [set ${token}(meta)]
              if {![info exist meta(Location)]} {
                 return $token
              }
              set url $meta(Location)
              unset meta
           }
        }
      
      Thank you,
      - Harald
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "oehhar"
    10. subsystem initialized to: "29. http Package"
    11. title initialized to: "http::geturl follow redirects"
    12. type initialized to: "RFE"
  2. Ticket change [827b32f27f] (rid 204059) by kjnash on 2022-09-10 12:15:17:

    1. assignee changed to: "aku"
    2. closedate changed to: "2459833.01061472"
    3. closer changed to: "kjnash"
    4. comment changed to:
      IMHO it would be helpful, if http::geturl would follow redirects automatically (or with an option).
      
      Following http://wiki.tcl.tk/1475
      
      Thus 
      ::http::geturl $url -followredirect 1
      would do:
      proc geturl_followRedirects {url args} {
           while {1} {
              set token [eval [list http::geturl $url] $args]
              switch -glob [http::ncode $token] {
                 30[1237] { ### redirect - see below ### }
                 default  { return $token }
              }
              upvar #0 $token state
              array set meta [set ${token}(meta)]
              if {![info exist meta(Location)]} {
                 return $token
              }
              set url $meta(Location)
              unset meta
           }
        }
      
      Thank you,
      - Harald
      
    5. icomment:
      Duplicate of [3102850].  I have copied Harald's comments there and closed this bug.
      
    6. login: "kjnash"
    7. mimetype: "text/x-fossil-plain"
    8. resolution changed to: "Duplicate"
    9. severity changed to: "Minor"
    10. status changed to: "Closed"