Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114001 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7356 invoked from network); 8 Apr 2021 12:41:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Apr 2021 12:41:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9AD921804F3 for ; Thu, 8 Apr 2021 05:41:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 8 Apr 2021 05:41:17 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id e8so2055418iok.5 for ; Thu, 08 Apr 2021 05:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=qNQU0JWOfJhfBdDwwX0ih2TWvylUgaUyMK1V55cD2jE=; b=LP/hHrARLM48I9hhv4dXKLrEI2ujBAzjY6BAkU3NLG8A0/dd86xCjUp7IZAPX0HO+v zlLf6gmn7Ef3y/muQeoJL0aYJwI6NlDHcUw6CNfydn99NImOl+8YBKdoZ9g934vThZxI bntBo8BfeL2uOWEyuggnRs4avjs3pmq4v2Hm+gndIOBIP8eiOwV1RD71OBqA1xJFZNXd DxJL6qGZ9/Os8k8YMwsKQBm65SN+lOuXHphtPy0amCyw18DuNOVaGBTk319J3bSVoq8i Iu1Gmj0fBD2PJUgtFvmRprrgt0JjeMKIZhlVtBAN3lZsrGQ45nKIt2o/Dlt/tb1f8MSU LEhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qNQU0JWOfJhfBdDwwX0ih2TWvylUgaUyMK1V55cD2jE=; b=dRmVPIR8E/uRVkiQOaqFrrgQyoqfRfpBNaGbAR1YppYbNh/HyuSrCNuw6i6GkcM7oh mYVaq0KjA3P8sOg/oP3GukTy65oUM/WJDIfzf5N0ee4ahSGvPYWmIz4KROTmi8wmEvz9 JyriISKsLx90Kmn591YfpPVehPthw2TTpzwhIrDLGRgii7XNFCUWTuPAk50GHXWptcuW vFoVWqMGnzoPKm8VMrullT1v91jO/ehAchwDD8BXcWcb1Xk33b1sEyF7U4BwrwvppGvz giuEDznEOmdnMYkZTb9tRC+PS/Wt2Ciiysg85dto4e9L/xwXyUFGYExwbonxkt1U41q1 QFRw== X-Gm-Message-State: AOAM5314J+GUV3tJY08XvXaM0h04Ri31wEtZTM3QzUzJJRN6cp+FLdaT ixc+leaJFDou7bGInXO6HDXlcPVMQHs+Zu8CEjriko+UF9M= X-Google-Smtp-Source: ABdhPJxTC4cAtoLqs9ruDQtR5/6aoJ7OUvFxMPKrGx95KS+2DBN9fl+r5U2Qzs2urOqE1PectdpwhTLVHXL4rvYQLz0= X-Received: by 2002:a05:6638:359:: with SMTP id x25mr8597774jap.112.1617885676526; Thu, 08 Apr 2021 05:41:16 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 8 Apr 2021 14:41:05 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000095ec305bf755da9" Subject: add php.ini entry to set default user_agent for curl From: paresy@gmail.com (Michael Maroszek) --000000000000095ec305bf755da9 Content-Type: text/plain; charset="UTF-8" Dear Internals, I'd like to suggest a new enhancement for 8.1 as outlined in the title. The initial pull request is here: https://github.com/php/php-src/pull/6834/files --- Details: Since quite a while PHP offers a dedicated user_agent php.ini entry, but it affects only all internal implementations like file_get_contents. cURL has no default and you need to modify CURLOPT_USERAGENT in the code and for the SoapClient there is a parameter 'user-agent' in the constructor which can be set. Therefore I'd like to introduce an equal entry for curl.user_agent which would set a default user_agent when making curl requests. Of course you can override it with CURLOPT_USERAGENT if required. (I can implement the same for SoapClient, if requested) --- Alternative: I could also use the default user_agent entry, but I wasn't sure what the best practise is and went for the more "local" approach for the initial implementation. --- Bigger picture: When the preferred solution is to use the default user_agent, we could also try to determine more places where i could send the default user_agent to give this php.ini entry a more consistent feeling. Thanks for your consideration, Michael PS: Subscribing to the list through https://www.php.net/mailing-lists.php is not possible and quits with the following error: We were unable to subscribe you due to some technical problems. Please try again later. --000000000000095ec305bf755da9--