gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-gnu-taler-payment-for-woocommerce] branch master updated: fix HTT


From: gnunet
Subject: [taler-gnu-taler-payment-for-woocommerce] branch master updated: fix HTTP header construction
Date: Thu, 23 Feb 2023 15:58:15 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnu-taler-payment-for-woocommerce.

The following commit(s) were added to refs/heads/master by this push:
     new 1fc0e6b  fix HTTP header construction
1fc0e6b is described below

commit 1fc0e6bcfee7b8edfd684f016fb85f27e6842611
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Feb 23 15:58:11 2023 +0100

    fix HTTP header construction
---
 class-wc-gnutaler-gateway.php | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/class-wc-gnutaler-gateway.php b/class-wc-gnutaler-gateway.php
index 1305479..5d859c1 100644
--- a/class-wc-gnutaler-gateway.php
+++ b/class-wc-gnutaler-gateway.php
@@ -184,7 +184,6 @@ function gnutaler_init_gateway_class() {
                                20,
                                4
                        );
-                       $this->debug( "GNU Taler payment gateway class 
constructed" );
                }
 
 
@@ -426,8 +425,6 @@ function gnutaler_init_gateway_class() {
                 * @return array The return array will either have the 
successful return value or a detailed error message.
                 */
                private function call_api( $method, $url, $body ): array {
-                       $this->warning( "Running " . $method . " on " . $url );
-
                        $apikey = $this->get_option( 
'GNU_Taler_Backend_API_Key' );
                        $args   = array(
                                'timeout'             => 30, // In seconds.
@@ -436,14 +433,14 @@ function gnutaler_init_gateway_class() {
                                'user-agent'          => '', // Minimize 
information leakage.
                                'blocking'            => true, // We do nothing 
without it.
                                'headers'             => array(
-                                       'Authorization: Bearer ' . $apikey,
+                                       'Authorization' => 'Bearer ' . $apikey,
                                ),
                                'decompress'          => true,
                                'limit_response_size' => 1024 * 1024, // More 
than enough.
                        );
                        if ( $body ) {
                                $args['body']      = wp_json_encode( $body, 
JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES, 16 );
-                               $args['headers'][] = 'Content-type: 
application/json';
+                               $args['headers']['Content-type'] = 
'application/json';
                                $args['compress']  = true;
                        }
                        $this->debug( 'Issuing HTTP ' . $method . ' request to 
' . $url . ' with options ' . wp_json_encode( $args ) . ' and body ' . $body );

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]