summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-10 12:00:20 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-10 12:00:20 +0100
commitce7935e82a31a312852c6fa738b10a8223bd8a7a (patch)
tree94d2d5e77cc6be688342e835a313791bfb339c54
parent40ba9f6a1ae5bf2776a580c6cf612402f8e3c04d (diff)
downloadphp-git-ce7935e82a31a312852c6fa738b10a8223bd8a7a.tar.gz
Don't pass null action to __doRequest
The parameter is not nullable, so it will be interpreted as an empty string anyway. The entire code here is pretty confusing though, and probably deserves a second loop. The HTTP code only send SOAPAction/action if soapaction is non-NULL -- but it always is, because it is accepted through a non-nullable string parameter. Regarding the SOAPAction header, it appears that always sending it is actually a requirement of the standard: > An HTTP client MUST use this header field when issuing a SOAP > HTTP Request. Although it does make a distinction between absence of value and an empty string: > The header field value of empty string ("") means that the intent > of the SOAP message is provided by the HTTP Request-URI. No value > means that there is no indication of the intent of the message. The empty string interpretation appears to be the desired one. However, for the action MIME tag the SOAP 1.2 Part 2 specification says that > The media type specifies an optional action parameter, which can > be used to optimize dispatch or routing, among other things. but also > The SOAP Action feature defines a single property, which is > described in Table 14. The value of this property MUST be an > absolute URI[RFC 3986] and MUST NOT be empty. which would indicate that we should not be sending an empty action here. As I'm not familiar with SOAP and this is long-standing behavior, I'm just leaving this alone for now...
-rw-r--r--ext/soap/soap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 3d76c0fc70..57a08eb3d2 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2217,7 +2217,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
ZVAL_STRINGL(&params[0], buf, buf_size);
ZVAL_STRING(&params[1], location);
if (action == NULL) {
- ZVAL_NULL(&params[2]);
+ ZVAL_EMPTY_STRING(&params[2]);
} else {
ZVAL_STRING(&params[2], action);
}