Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -68,7 +68,7 @@ class _Sockets
|
||||
$this->httpVersion = $httpVersion ?: '1.1';
|
||||
$this->timeout = $timeout;
|
||||
$this->followRedirects = $followRedirects;
|
||||
|
||||
|
||||
/* Set our basic settings */
|
||||
stream_context_set_option( $this->context, array(
|
||||
'http' => array(
|
||||
@@ -79,6 +79,7 @@ class _Sockets
|
||||
),
|
||||
'ssl' => array(
|
||||
'verify_peer' => FALSE,
|
||||
'crypto_method' => STREAM_CRYPTO_METHOD_ANY_CLIENT
|
||||
)
|
||||
) );
|
||||
}
|
||||
@@ -180,7 +181,7 @@ class _Sockets
|
||||
/* Set the method and the Content-Length header if this is a POST, PUT or PATCH request */
|
||||
stream_context_set_option( $this->context, 'http', 'method', $method );
|
||||
|
||||
if( in_array( $method, array( 'POST', 'PUT', 'PATCH' ) ) )
|
||||
if( $data )
|
||||
{
|
||||
$this->setHeaders( array( 'Content-Length' => \strlen( $data ) ) );
|
||||
}
|
||||
@@ -192,7 +193,7 @@ class _Sockets
|
||||
}
|
||||
|
||||
$hostname = sprintf( '%s%s:%d',
|
||||
( $this->url->data['scheme'] === 'https' ) ? 'tls://' : '',
|
||||
( $this->url->data['scheme'] === 'https' ) ? 'ssl://' : '',
|
||||
$this->url->data['host'],
|
||||
isset( $this->url->data['port'] )
|
||||
? $this->url->data['port']
|
||||
@@ -217,7 +218,7 @@ class _Sockets
|
||||
|
||||
/* Get the location */
|
||||
$location = $this->url->data['path'] ? \IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_PATH, $this->url->data['path'] ) : '';
|
||||
$location .= $this->url->data['query'] ? '?' . \IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_QUERY, $this->url->data['query'] ) : '';
|
||||
$location .= ( count( $this->url->queryString ) ) ? '?' . \IPS\Http\Url::convertQueryAsArrayToString( $this->url->queryString, true ) : '';
|
||||
$location .= $this->url->data['fragment'] ? '#' . \IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_FRAGMENT, $this->url->data['fragment'] ) : '';
|
||||
|
||||
/* Send request */
|
||||
|
||||
Reference in new issue
Block a user