mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
socketutil: use Device.model directly (#12992)
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run
Device:info() is multiline on Android, see https://github.com/koreader/koreader/pull/12977#issuecomment-2568355984
This commit is contained in:
@@ -17,7 +17,7 @@ local socketutil = {
|
||||
|
||||
--- Builds a sensible UserAgent that fits Wikipedia's UA policy <https://meta.wikimedia.org/wiki/User-Agent_policy>
|
||||
local socket_ua = http.USERAGENT
|
||||
socketutil.USER_AGENT = "KOReader/" .. Version:getShortVersion() .. " (" .. Device:info() .. "; " .. jit.os .. "; " .. jit.arch .. ") " .. socket_ua:gsub(" ", "/")
|
||||
socketutil.USER_AGENT = "KOReader/" .. Version:getShortVersion() .. " (" .. Device.model .. "; " .. jit.os .. "; " .. jit.arch .. ") " .. socket_ua:gsub(" ", "/")
|
||||
-- Monkey-patch it in LuaSocket, as it already takes care of inserting the appropriate header to its requests.
|
||||
http.USERAGENT = socketutil.USER_AGENT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user