sitemule / ILEastic

Embedded application server for ILE on IBM i
Apache License 2.0
58 stars 29 forks source link

Add support for a pre response hook for plugins #71

Closed m1h43l closed 4 years ago

m1h43l commented 5 years ago

We need to be able to hook into the response before it is send over the network.

Sometimes the response needs to be modified before sending f. e. CORS support, #34 . CORS needs to add some extra headers to the response.

m1h43l commented 4 years ago

@NielsLiisberg As the response struct is already available to the plugin as a parameter can we already add the HTTP header on the existing pre request hook? Then at least for setting the CORS headers there is no need for any additional hooks.

m1h43l commented 4 years ago

Reponse data structure is also available in the PRE_REQUEST hook. So we can also modify the response there. Is good enough for me atm.