socketutil: use Device.model directly (#12992)

Device:info() is multiline on Android, see https://github.com/koreader/koreader/pull/12977#issuecomment-2568355984
This commit is contained in:
Frans de Jonge
2025-01-02 23:06:55 +01:00
committed by GitHub
parent 016592e0a3
commit 65e4124e5d

View File

@@ -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