mirror of
https://github.com/koreader/koreader.git
synced 2025-12-24 12:14:05 +01:00
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:
@@ -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