PowerDNS/weakforced

[FEATURE] setCustomGetEndpoint should set the Last-Modified header to the current time

sshipway opened this issue · 4 comments

Is your feature request related to a problem? Please describe.
In order to use wforced as a IP blacklist source for pfBlockerNG, it needs to provide a list of IP addresses, which it can do. However it needs to have a Last-Modified header which is not provided, and so the data are rejected.

Describe the solution you'd like
The HTTP returned should have the Last-Modified header set to the current time.

Describe alternatives you've considered
As this is specifically for pfBlocker integration, the only workaround has been to have a separate cronjob retrieving the data and placing it into a local file to be picked up.

Additional context
It might make sense for all returned HTTP responses from any call to include this header

In fact, it might be best to set Date and Last-Modified both to the same value (IE 'now') for optimum compatibility.

Yeah, this seems pretty doable

We should add this header for all REST API responses I think

I agree; although the Date and Last-Modified are defined as optional, there may be other integrations that expect them to be present, and it shouldn't be too much trouble to add them to everything (hopefully)

It might be possible to allow the customGetEndpoint function to optionally return a hash of arbitrary headers along with the content?