YahooArchive / mojito

[archiving soon] Yahoo! Mojito Framework
BSD 3-Clause "New" or "Revised" License
1.57k stars 214 forks source link

Static context not reflected in request's context #1376

Closed aljimenez closed 10 years ago

aljimenez commented 10 years ago

The context defined at start up time is not reflected per request. For example if the environment is set to "development" at startup, I would expect req.context.environment to be equal to "development" unless that request overwrites the environment dimension. Instead req.context.environment remains undefined. The mojito-contextualizer middleware should mix the static context to the request's context, giving the request's context precedence.

drewfish commented 10 years ago

I totally agree. This caused me trouble when I was writing an app with Mojito, and I wound up implementing my own contextualizing middleware that did just this.

aljimenez commented 10 years ago

Ok, I can fix it; it should be an easy fix. Just wanted to make sure this wasn't by design.

aljimenez commented 10 years ago

Pull request #1378

moeinnb76 commented 10 years ago

1377