redirect.es.tst 515 B

12345678910111213141516171819202122232425
  1. /*
  2. redirect.tst - Redirection tests
  3. */
  4. const HTTP = tget('TM_HTTP') || "127.0.0.1:8080"
  5. let http: Http = new Http
  6. // First just test a normal get
  7. http.get(HTTP + "/dir/index.html")
  8. ttrue(http.status == 200)
  9. http.followRedirects = false
  10. http.get(HTTP + "/dir")
  11. ttrue(http.status == 302)
  12. http.followRedirects = true
  13. http.get(HTTP + "/dir")
  14. ttrue(http.status == 200)
  15. /*
  16. http.followRedirects = true
  17. http.get(HTTP + "/dir/")
  18. ttrue(http.status == 200)
  19. ttrue(http.response.contains("Hello /dir/index.html"))
  20. */