Skip to content

User-Agent header not set by notify_push nor test_client #688

@yds

Description

@yds

my logs are full of this error:

WARN [notify_push::connection] /build/source/src/connection.rs:99: Error while sending authentication request to nextcloud: Client error: 403 Forbidden

this is because NextCloud is deployed behind HAProxy with an anti-DDoS setting to block any connections without something/anything set in the User-Agent header:

http-request deny unless { req.hdr(user-agent) -m found }

here's a link to a Lighttpd recipe to enable the same anti-DDoS measures.

disabling these anti-DDoS measures to allow for notify_push requests to get through is not a wise choice -- the number of attacks attempts goes up noticeably.

to properly fix this, notify_push and test_client should always set a User-Agent header to something like notify_push/1.3.0 when making http requests. Any non-empty setting will do -- most anti-DDoS recipes look for empty and blacklisted User-Agent strings.

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