Skip to content

Updating the GeoIP database gives error #1287

@dwhile

Description

@dwhile

When updating the GeoIP database from the interface the following is output:

Downloading file, please wait...
Error occurred while downloading GeoIP data file: Response could not be parsed
Download complete, unpacking files...

GeoIP data file successfully unpacked
Process completed!

On investigation it is because the server is using the HTTP2 protocol and in mailscanner/lib/request/Request.php the returned headers are only checked for a 1.{x} response. So an error is generated.

changing line 572 in mailscanner/lib/request/Request.php from:
preg_match('#^HTTP/1.\d[ \t]+(\d+)#i', array_shift($headers), $matches);
to:
preg_match('#^HTTP[/1.\d]|[2][ \t]+(\d+)#i', array_shift($headers), $matches);

Solves this problem and allows the update to work correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions