Discussion:
Bug#863286: completely broken in non-US locales
(too old to reply)
Steinar H. Gunderson
2017-05-24 22:10:02 UTC
Permalink
Package: lua-http
Version: 0.1-1
Severity: grave
Tags: upstream

Hi,

lua-http cannot construct legal requests if a non-US locale (or more precisely,
anything using comma as decimal separator) is in use. Example:

klump:~> cat test.lua
os.setlocale('nb_NO.UTF-8')
local http_request = require "http.request"
local headers, stream = assert(http_request.new_from_uri("http://example.com"):go())
local body = assert(stream:get_body_as_string())
if headers:get ":status" ~= "200" then
error(body)
end
print(body)

klump:~> lua5.2 test.lua
lua5.2: test.lua:6: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>505 - HTTP Version Not Supported</title>
</head>
<body>
<h1>505 - HTTP Version Not Supported</h1>
</body>
</html>

stack traceback:
[C]: in function 'error'
test.lua:6: in main chunk
[C]: in ?

This is because the request it constructs looks like this:

GET / HTTP/1,1
host: example.com
user-agent: lua-http/0.1

Note the “1,1” in the HTTP version number where it should have been 1.1.

This makes the library completely broken for a large swath of Debian's user base;
thus the severity.

-- System Information:
Debian Release: 9.0
APT prefers testing-proposed-updates
APT policy: (500, 'testing-proposed-updates'), (500, 'testing')
Architecture: amd64
(x86_64)
Foreign Architectures: i386

Kernel: Linux 4.11.2 (SMP w/40 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh lin
Daurnimator
2017-05-25 01:40:01 UTC
Permalink
Post by Steinar H. Gunderson
lua-http cannot construct legal requests if a non-US locale (or more precisely,
anything using comma as decimal separator) is in use.
Fixed upstream in
https://github.com/daurnimator/lua-http/commit/f822bbef48f8ee6b42ce4cca843d4cc10cd0f775
Daurnimator
2017-05-28 06:10:01 UTC
Permalink
However I'm hoping to make a 0.2 release today that includes the fix
(as well as others that weren't reported to debian directly): please
consider packaging that instead.
See http://daurnimator.com/post/161154248644/lua-http-v02-released and
https://github.com/daurnimator/lua-http/releases/tag/v0.2
Santiago
2017-05-28 10:20:01 UTC
Permalink
In case you want to test it, I've uploaded a patched version to my
https://people.debian.org/~santiago/debian/santiago-unstable/
If patching the upstream, please update the version in
http/version.lua to something like version="0.1.debian-1"
However I'm hoping to make a 0.2 release today that includes the fix
(as well as others that weren't reported to debian directly): please
consider packaging that instead.
Thanks for the heads-up.

Since Debian testing is currently frozen (and Stretch will be released
next month), only specific changes to solve release-critical bugs are
allowed to propagate from unstable to testing.
So, to have this bug fixed in the next stable release, it is needed to
patch the current version.

Why updating http/version.lua is needed?

Cheers,

Santiago

P.S.1 The 0.2 release could enter into unstable after Stretch release.

P.S.2 I am not the maintainer. Ondřej, do you agree with the changes? Do
you want to apply them by yourself? I'd happy to upload if it's OK to
you.
Debian Bug Tracking System
2017-05-27 15:50:02 UTC
Permalink
tags -1 + patch
Bug #863286 [lua-http] completely broken in non-US locales
Added tag(s) patch.
--
863286: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863286
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Debian Bug Tracking System
2017-05-29 12:10:01 UTC
Permalink
Your message dated Mon, 29 May 2017 12:03:40 +0000
with message-id <E1dFJOe-00038U-***@fasolo.debian.org>
and subject line Bug#863286: fixed in lua-http 0.1-3
has caused the Debian Bug report #863286,
regarding completely broken in non-US locales
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ***@bugs.debian.org
immediately.)
--
863286: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863286
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Loading...