protojure / lib

A collection of libraries to support Protojure applications at runtime
https://protojure.readthedocs.io
Apache License 2.0
64 stars 14 forks source link

Add all default attributes supported by Pedestal to request-map #138

Closed janosmeszaros closed 2 years ago

janosmeszaros commented 2 years ago

Currently only a subset of attributes is populated into the request-map of the ones which are provided by Pedestal by default. I believe it would make sense to mimic Pedestal's behaviour in this so one could expect the same request-map as one would using Pedestal in the interceptors even if the server was created by protojure. What do you think?

ghaskins commented 2 years ago

Some of those (e.g. *-params) are provided upstream by interceptors and wouldn't be appropriate to set by the container. However, some of the others like :remote-addr and :server-name can only be set by the container and make sense to add. PR welcome.

janosmeszaros commented 2 years ago

Yes, I was thinking about the ones which are marked Always Present? (sorry if that was not clear) as I believe those are available at that point. Let me put together a PR.

ghaskins commented 2 years ago

I would suggest basing it on whether it says in the description that it is provided by an interceptor or not. For instance, some fields are not always present but still would need to be sourced by the container (e.g. :content-type)