8000 Issue when multiple subdivisions are returned · Issue #7 · anjia0532/lua-resty-maxminddb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Issue when multiple subdivisions are returned #7
Closed
@losmicar

Description

@losmicar

Hi,

Script will break when multiple subdivisions are returned from maxmind-db and this error will be logged: Expected comma or array end but found T_OBJ_BEGIN at character 980

Tested with this ip: 194.187.249.181 (France)

Script will try to return invalid constructed json that could not be parsed later on:

"subdivisions": [{
"geoname_id": 11071623,
"iso_code": "OCC",
"names": {
"en": "Occitanie",
"fr": "Occitanie"
}
} {
"geoname_id": 3036965,
"iso_code": "09",
"names": {
"de": "Ariège",
"en": "Ariège",
"es": "Arieja",
"fr": "Ariège"
}
}]

Comma is missing between these two objects.

I've personally solved it modifying the _dump_entry_data_list function where array is handled adding additional condition:

if size>0 then
table.insert(resultTab, ",");
end

Here is a print screen:
https://www.dropbox.com/s/u1jwuj03nkmzcbm/Screenshot%202018-07-11%2013.22.44.png?dl=0

Hope this helps,
Thanks

3F81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0