mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
uri/win_uri: Make method a free text field (#49719)
* uri/win_uri: Make method a free text field Since various interfaces introduce their own HTTP method (e.g. like PROPFIND, LIST or TRACE) it's better to leave this up to the user. * Fix HTTP method check in module_utils urls * Add integration test for method UNKNOWN * Clarify the change as requested during review
This commit is contained in:
@@ -390,6 +390,20 @@
|
||||
- result is failure
|
||||
- "'failed to parse body as form_urlencoded: too many values to unpack' in result.msg"
|
||||
|
||||
- name: Validate invalid method
|
||||
uri:
|
||||
url: https://{{ httpbin_host }}/anything
|
||||
method: UNKNOWN
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Assert invalid method fails
|
||||
assert:
|
||||
that:
|
||||
- result is failure
|
||||
- result.status == 405
|
||||
- "'METHOD NOT ALLOWED' in result.msg"
|
||||
|
||||
- name: Test client cert auth, no certs
|
||||
uri:
|
||||
url: "https://ansible.http.tests/ssl_client_verify"
|
||||
|
||||
@@ -336,6 +336,20 @@
|
||||
- get_custom_header.json.headers['Test-Header'] == 'hello'
|
||||
- get_custom_header.json.headers['Another-Header'] == 'world'
|
||||
|
||||
- name: Validate invalid method
|
||||
win_uri:
|
||||
url: https://{{ httpbin_host }}/anything
|
||||
method: UNKNOWN
|
||||
register: invalid_method
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Assert invalid method fails
|
||||
assert:
|
||||
that:
|
||||
- invalid_method is failure
|
||||
- invalid_method.status_code == 405
|
||||
- invalid_method.status_description == 'METHOD NOT ALLOWED'
|
||||
|
||||
# client cert auth tests
|
||||
|
||||
- name: get request with timeout
|
||||
|
||||
Reference in New Issue
Block a user