Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 22676a1419b0ec3311bfc7070caf58e61579dd93
Ticket: 3612478fffffffffffffffffffffffffffffffff
http::geturl follow redirects
User & Date: oehhar on 2013-05-02 11:35:53
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. 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
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "oehhar"
  10. subsystem changed to: "29. http Package"
  11. title changed to: "http::geturl follow redirects"
  12. type changed to: "RFE"