|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
# NOTE: The HTTP HEAD turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 301 using HEAD
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=301&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=301&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: HEAD
|
|
|
|
@ -12,14 +12,14 @@
|
|
|
|
|
- http_301_head is successful
|
|
|
|
|
- http_301_head.json.data == ''
|
|
|
|
|
- http_301_head.json.method == 'GET'
|
|
|
|
|
- http_301_head.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_head.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_head.redirected == true
|
|
|
|
|
- http_301_head.status == 200
|
|
|
|
|
- http_301_head.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_head.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
- name: Test HTTP 301 using GET
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=301&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=301&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: GET
|
|
|
|
@ -30,15 +30,15 @@
|
|
|
|
|
- http_301_get is successful
|
|
|
|
|
- http_301_get.json.data == ''
|
|
|
|
|
- http_301_get.json.method == 'GET'
|
|
|
|
|
- http_301_get.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_get.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_get.redirected == true
|
|
|
|
|
- http_301_get.status == 200
|
|
|
|
|
- http_301_get.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_get.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# NOTE: The HTTP POST turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 301 using POST
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=301&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=301&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: POST
|
|
|
|
@ -51,15 +51,15 @@
|
|
|
|
|
- http_301_post is successful
|
|
|
|
|
- http_301_post.json.data == ''
|
|
|
|
|
- http_301_post.json.method == 'GET'
|
|
|
|
|
- http_301_post.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_post.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_post.redirected == true
|
|
|
|
|
- http_301_post.status == 200
|
|
|
|
|
- http_301_post.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_301_post.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# NOTE: The HTTP HEAD turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 302 using HEAD
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=302&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=302&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: HEAD
|
|
|
|
@ -70,14 +70,14 @@
|
|
|
|
|
- http_302_head is successful
|
|
|
|
|
- http_302_head.json.data == ''
|
|
|
|
|
- http_302_head.json.method == 'GET'
|
|
|
|
|
- http_302_head.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_head.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_head.redirected == true
|
|
|
|
|
- http_302_head.status == 200
|
|
|
|
|
- http_302_head.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_head.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
- name: Test HTTP 302 using GET
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=302&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=302&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: GET
|
|
|
|
@ -88,15 +88,15 @@
|
|
|
|
|
- http_302_get is successful
|
|
|
|
|
- http_302_get.json.data == ''
|
|
|
|
|
- http_302_get.json.method == 'GET'
|
|
|
|
|
- http_302_get.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_get.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_get.redirected == true
|
|
|
|
|
- http_302_get.status == 200
|
|
|
|
|
- http_302_get.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_get.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# NOTE: The HTTP POST turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 302 using POST
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=302&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=302&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: POST
|
|
|
|
@ -109,15 +109,15 @@
|
|
|
|
|
- http_302_post is successful
|
|
|
|
|
- http_302_post.json.data == ''
|
|
|
|
|
- http_302_post.json.method == 'GET'
|
|
|
|
|
- http_302_post.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_post.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_post.redirected == true
|
|
|
|
|
- http_302_post.status == 200
|
|
|
|
|
- http_302_post.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_302_post.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# NOTE: The HTTP HEAD turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 303 using HEAD
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=303&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=303&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: HEAD
|
|
|
|
@ -128,14 +128,14 @@
|
|
|
|
|
- http_303_head is successful
|
|
|
|
|
- http_303_head.json.data == ''
|
|
|
|
|
- http_303_head.json.method == 'GET'
|
|
|
|
|
- http_303_head.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_head.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_head.redirected == true
|
|
|
|
|
- http_303_head.status == 200
|
|
|
|
|
- http_303_head.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_head.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
- name: Test HTTP 303 using GET
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=303&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=303&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: GET
|
|
|
|
@ -146,15 +146,15 @@
|
|
|
|
|
- http_303_get is successful
|
|
|
|
|
- http_303_get.json.data == ''
|
|
|
|
|
- http_303_get.json.method == 'GET'
|
|
|
|
|
- http_303_get.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_get.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_get.redirected == true
|
|
|
|
|
- http_303_get.status == 200
|
|
|
|
|
- http_303_get.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_get.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# NOTE: The HTTP POST turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 303 using POST
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=303&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=303&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: POST
|
|
|
|
@ -167,15 +167,15 @@
|
|
|
|
|
- http_303_post is successful
|
|
|
|
|
- http_303_post.json.data == ''
|
|
|
|
|
- http_303_post.json.method == 'GET'
|
|
|
|
|
- http_303_post.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_post.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_post.redirected == true
|
|
|
|
|
- http_303_post.status == 200
|
|
|
|
|
- http_303_post.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_303_post.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# NOTE: The HTTP HEAD turns into an HTTP GET
|
|
|
|
|
- name: Test HTTP 307 using HEAD
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=307&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=307&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: HEAD
|
|
|
|
@ -186,14 +186,14 @@
|
|
|
|
|
- http_307_head is successful
|
|
|
|
|
- http_307_head.json.data == ''
|
|
|
|
|
- http_307_head.json.method == 'GET'
|
|
|
|
|
- http_307_head.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_head.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_head.redirected == true
|
|
|
|
|
- http_307_head.status == 200
|
|
|
|
|
- http_307_head.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_head.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
- name: Test HTTP 307 using GET
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=307&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=307&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: GET
|
|
|
|
@ -204,15 +204,15 @@
|
|
|
|
|
- http_307_get is successful
|
|
|
|
|
- http_307_get.json.data == ''
|
|
|
|
|
- http_307_get.json.method == 'GET'
|
|
|
|
|
- http_307_get.json.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_get.json.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_get.redirected == true
|
|
|
|
|
- http_307_get.status == 200
|
|
|
|
|
- http_307_get.url == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_get.url == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# FIXME: This is fixed in https://github.com/ansible/ansible/pull/36809
|
|
|
|
|
- name: Test HTTP 307 using POST
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=307&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=307&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: POST
|
|
|
|
@ -225,16 +225,16 @@
|
|
|
|
|
that:
|
|
|
|
|
- http_307_post is failure
|
|
|
|
|
- http_307_post.json is not defined
|
|
|
|
|
- http_307_post.location == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_post.location == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- "http_307_post.msg == 'Status code was 307 and not [200]: HTTP Error 307: TEMPORARY REDIRECT'"
|
|
|
|
|
- http_307_post.redirected == false
|
|
|
|
|
- http_307_post.status == 307
|
|
|
|
|
- http_307_post.url == 'http://{{ httpbin_host }}/redirect-to?status_code=307&url=http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_307_post.url == 'https://{{ httpbin_host }}/redirect-to?status_code=307&url=https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# FIXME: This is fixed in https://github.com/ansible/ansible/pull/36809
|
|
|
|
|
- name: Test HTTP 308 using HEAD
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=308&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=308&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: GET
|
|
|
|
@ -245,16 +245,16 @@
|
|
|
|
|
that:
|
|
|
|
|
- http_308_head is failure
|
|
|
|
|
- http_308_head.json is not defined
|
|
|
|
|
- http_308_head.location == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_308_head.location == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- "http_308_head.msg == 'Status code was 308 and not [200]: HTTP Error 308: UNKNOWN'"
|
|
|
|
|
- http_308_head.redirected == false
|
|
|
|
|
- http_308_head.status == 308
|
|
|
|
|
- http_308_head.url == 'http://{{ httpbin_host }}/redirect-to?status_code=308&url=http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_308_head.url == 'https://{{ httpbin_host }}/redirect-to?status_code=308&url=https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# FIXME: This is fixed in https://github.com/ansible/ansible/pull/36809
|
|
|
|
|
- name: Test HTTP 308 using GET
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=308&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=308&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: GET
|
|
|
|
@ -265,16 +265,16 @@
|
|
|
|
|
that:
|
|
|
|
|
- http_308_get is failure
|
|
|
|
|
- http_308_get.json is not defined
|
|
|
|
|
- http_308_get.location == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_308_get.location == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- "http_308_get.msg == 'Status code was 308 and not [200]: HTTP Error 308: UNKNOWN'"
|
|
|
|
|
- http_308_get.redirected == false
|
|
|
|
|
- http_308_get.status == 308
|
|
|
|
|
- http_308_get.url == 'http://{{ httpbin_host }}/redirect-to?status_code=308&url=http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_308_get.url == 'https://{{ httpbin_host }}/redirect-to?status_code=308&url=https://{{ httpbin_host }}/anything'
|
|
|
|
|
|
|
|
|
|
# FIXME: This is fixed in https://github.com/ansible/ansible/pull/36809
|
|
|
|
|
- name: Test HTTP 308 using POST
|
|
|
|
|
uri:
|
|
|
|
|
url: http://{{ httpbin_host }}/redirect-to?status_code=308&url=http://{{ httpbin_host }}/anything
|
|
|
|
|
url: https://{{ httpbin_host }}/redirect-to?status_code=308&url=https://{{ httpbin_host }}/anything
|
|
|
|
|
follow_redirects: urllib2
|
|
|
|
|
return_content: yes
|
|
|
|
|
method: POST
|
|
|
|
@ -287,8 +287,8 @@
|
|
|
|
|
that:
|
|
|
|
|
- http_308_post is failure
|
|
|
|
|
- http_308_post.json is not defined
|
|
|
|
|
- http_308_post.location == 'http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_308_post.location == 'https://{{ httpbin_host }}/anything'
|
|
|
|
|
- "http_308_post.msg == 'Status code was 308 and not [200]: HTTP Error 308: UNKNOWN'"
|
|
|
|
|
- http_308_post.redirected == false
|
|
|
|
|
- http_308_post.status == 308
|
|
|
|
|
- http_308_post.url == 'http://{{ httpbin_host }}/redirect-to?status_code=308&url=http://{{ httpbin_host }}/anything'
|
|
|
|
|
- http_308_post.url == 'https://{{ httpbin_host }}/redirect-to?status_code=308&url=https://{{ httpbin_host }}/anything'
|
|
|
|
|