rexyai / RestRserve

R web API framework for building high-performance microservices and app backends
https://restrserve.org
271 stars 31 forks source link

add response header Date #177

Closed mrchypark closed 2 years ago

mrchypark commented 2 years ago

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date

Date res header provide is helpful.

In my case, I use middleware like below.


  process_response = function(.req, .res) {
    # compress body
    .res$set_header("Date", paste(format(Sys.time(), "%a, %d %b %Y %H:%M:%S", tz = "gmt"), "GMT"))
  },
  id = "date_header"
)```

but may add default setting, It will usefull.
artemklevtsov commented 2 years ago

RestRserve::Response provides the set_date method for this.