comparison urllog.tcl @ 583:d5fc3ecee4c7

urllog: Handle 303 redirects.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 10 Jan 2021 14:57:30 +0200
parents 148c7553c50f
children 9b64f201b3a7
comparison
equal deleted inserted replaced
582:1ace0cbde1dd 583:d5fc3ecee4c7
346 if {![urllog_dorequest $urlNick $urlChan $urlStr ustatus uscode ucode udata umeta]} { 346 if {![urllog_dorequest $urlNick $urlChan $urlStr ustatus uscode ucode udata umeta]} {
347 return 1 347 return 1
348 } 348 }
349 349
350 ### Handle redirects 350 ### Handle redirects
351 if {$ucode >= 301 && $ucode <= 302} { 351 if {$ucode >= 301 && $ucode <= 303} {
352 set nurlStr $umeta(Location) 352 set nurlStr $umeta(Location)
353 if {![regexp "\[a-z\]+://" $nurlStr]} { 353 if {![regexp "\[a-z\]+://" $nurlStr]} {
354 if {[string range $nurlStr 0 0] != "/"} { 354 if {[string range $nurlStr 0 0] != "/"} {
355 append nurlStr "/" 355 append nurlStr "/"
356 } 356 }
367 return 1 367 return 1
368 } 368 }
369 } 369 }
370 370
371 ### Handle 2nd level redirects 371 ### Handle 2nd level redirects
372 if {$ucode >= 301 && $ucode <= 302} { 372 if {$ucode >= 301 && $ucode <= 303} {
373 set nurlStr $umeta(Location) 373 set nurlStr $umeta(Location)
374 if {![regexp "\[a-z\]+://" $nurlStr]} { 374 if {![regexp "\[a-z\]+://" $nurlStr]} {
375 if {[string range $nurlStr 0 0] != "/"} { 375 if {[string range $nurlStr 0 0] != "/"} {
376 append nurlStr "/" 376 append nurlStr "/"
377 } 377 }