daurnimator / lua-http

HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.
https://daurnimator.github.io/lua-http/
MIT License
795 stars 81 forks source link

tests fails for lua-http v0.2 on alpine linux #132

Closed ncopa closed 5 years ago

ncopa commented 5 years ago

It happens with lua 5.1, 5.2 and 5.3 on at least x86, x86_64 and s390x. (I haven't tested armhf, aarch64 or ppc64le).

With lua5.1:

Error _ spec/request_spec.lua @ 823
http.request module :go method pays attention to HSTS
spec/request_spec.lua:901: bad argument #3 to '?' (value expected)
stack traceback:
        [C]: ?
        [C]: in function 'match'
        ./http/request.lua:585: in function 'go'
        spec/request_spec.lua:878: in function <spec/request_spec.lua:852>

Error _ spec/request_spec.lua @ 904
http.request module :go method handles HSTS corner case: max-age missing value
spec/request_spec.lua:493: bad argument #3 to '?' (value expected)
stack traceback:
        [C]: ?
        [C]: in function 'match'
        ./http/request.lua:585: in function 'go'
        spec/request_spec.lua:918: in function 'client_cb'
        spec/request_spec.lua:491: in function <spec/request_spec.lua:484>

Error _ spec/request_spec.lua @ 944
http.request module :go method handles HSTS corner case: 'preload' parameter
spec/request_spec.lua:493: bad argument #3 to '?' (value expected)
stack traceback:
        [C]: ?
        [C]: in function 'match'
        ./http/request.lua:585: in function 'go'
        spec/request_spec.lua:958: in function 'client_cb'
        spec/request_spec.lua:491: in function <spec/request_spec.lua:484>

Lua 5.2:

Error _ spec/request_spec.lua @ 823     
http.request module :go method pays attention to HSTS
spec/request_spec.lua:901: bad argument #3 to '_G.rawset' (value expected)
stack traceback:                         
        [C]: in function '_G.rawset'    
        [C]: in function 'match'           
        ./http/request.lua:585: in function 'go'
        spec/request_spec.lua:878: in function <spec/request_spec.lua:852>

Error _ spec/request_spec.lua @ 904        
http.request module :go method handles HSTS corner case: max-age missing value
spec/request_spec.lua:493: bad argument #3 to '_G.rawset' (value expected)
stack traceback:                        
        [C]: in function '_G.rawset'   
        [C]: in function 'match'           
        ./http/request.lua:585: in function 'go'
        spec/request_spec.lua:918: in function 'client_cb'
        spec/request_spec.lua:491: in function <spec/request_spec.lua:484>

Error _ spec/request_spec.lua @ 944      
http.request module :go method handles HSTS corner case: 'preload' parameter
spec/request_spec.lua:493: bad argument #3 to '_G.rawset' (value expected)
stack traceback:                       
        [C]: in function '_G.rawset'       
        [C]: in function 'match'   
        ./http/request.lua:585: in function 'go'
        spec/request_spec.lua:958: in function 'client_cb'
        spec/request_spec.lua:491: in function <spec/request_spec.lua:484>

With lua 5.3:

Error _ spec/request_spec.lua @ 823     
http.request module :go method pays attention to HSTS
spec/request_spec.lua:901: bad argument #3 to 'rawset' (value expected)
stack traceback:                         
        [C]: in function 'rawset'             
        [C]: in function 'lpeg.match'   
        ./http/request.lua:585: in method 'go'
        spec/request_spec.lua:878: in function <spec/request_spec.lua:852>

Error _ spec/request_spec.lua @ 904  
http.request module :go method handles HSTS corner case: max-age missing value
spec/request_spec.lua:493: bad argument #3 to 'rawset' (value expected)
stack traceback:                         
        [C]: in function 'rawset'             
        [C]: in function 'lpeg.match'   
        ./http/request.lua:585: in method 'go'
        spec/request_spec.lua:918: in upvalue 'client_cb'
        spec/request_spec.lua:491: in function <spec/request_spec.lua:484>

Error _ spec/request_spec.lua @ 944       
http.request module :go method handles HSTS corner case: 'preload' parameter
spec/request_spec.lua:493: bad argument #3 to 'rawset' (value expected)
stack traceback:                        
        [C]: in function 'rawset'          
        [C]: in function 'lpeg.match'
        ./http/request.lua:585: in method 'go'
        spec/request_spec.lua:958: in upvalue 'client_cb'
        spec/request_spec.lua:491: in function <spec/request_spec.lua:484>
ncopa commented 5 years ago

Seems like downgrading lua-lpeg_patterns from 0.5 to 0.4 makes tests work again.

daurnimator commented 5 years ago

Seems like downgrading lua-lpeg_patterns from 0.5 to 0.4 makes tests work again.

Yes. lpeg_patterns (acknowledgingly) broke compatibility. Looks like you already found the lua-http patch to bring compat back in line.

ncopa commented 5 years ago

I did. Would be nice with a new release tag for lua-http though. Thanks