Skip to content

Commit

Permalink
socketutil: use Device.model directly (koreader#12992)
Browse files Browse the repository at this point in the history
Device:info() is multiline on Android, see koreader#12977 (comment)
  • Loading branch information
Frenzie authored Jan 2, 2025
1 parent 016592e commit 65e4124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/socketutil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 65e4124

Please sign in to comment.