unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61916: 30.0.50; url.el; Can not change User-Agent temporarily when url-retrieve
@ 2023-03-02 13:37 xhcoding
  0 siblings, 0 replies; only message in thread
From: xhcoding @ 2023-03-02 13:37 UTC (permalink / raw)
  To: 61916


The following code cannot be used to temporarily change User-Agent

(require 'url)
(setq url-debug t)
(let ((url-user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.57"))
  (url-retrieve "https://httpbin.org/get?a=b" (lambda (_))))


Because the url-retrieve is asynchronous, when the url-user-agent is actually used (eg. url-http-create-request be called),
it may be out of the let scope.



In GNU Emacs 30.0.50 (build 5, x86_64-w64-mingw32)
Repository revision: 07a76a06f9a438e2a1bf1e565e3e78f7927c37f2
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.22621
System Description: Microsoft Windows 10 Home China (v10.0.2009.22621.1105)

Configured using:
 'configure --prefix=/d/emacs-build/pkg/master-x86_64 'CFLAGS=-Ofast -fno-finite-math-only -fomit-frame-pointer'
 --with-zlib --with-xpm --with-xml2 --with-tree-sitter --without-tiff --with-rsvg --with-png --with-lcms2 --with-json
 --with-jpeg --with-harfbuzz --with-gnutls --with-gif --without-cairo --disable-build-details --without-dbus
 --with-compress-install --with-small-ja-dic'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

Important settings:
  value of $LANG: CHS
  locale-coding-system: cp936

Major mode: ELisp/d






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-02 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 13:37 bug#61916: 30.0.50; url.el; Can not change User-Agent temporarily when url-retrieve xhcoding

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).