lusca icon indicating copy to clipboard operation
lusca copied to clipboard

A way to defer the header setup

Open facundocabrera opened this issue 9 years ago • 3 comments

Hey all,

I was having problems between lusca and another code I was trying to integrated, specifically speaking, doing redirections based on some conditions like expired sessions with 401 status code.

Could be possible to do something to defer the headers for some urls or some conditions?

facundocabrera avatar Mar 25 '15 17:03 facundocabrera

Are you using this module with kraken or just standalone for an express app maybe ?

pvenkatakrishnan avatar Mar 25 '15 17:03 pvenkatakrishnan

Yes, I'm using kraken as baseline for my project.

facundocabrera avatar Mar 25 '15 18:03 facundocabrera

then you must be able to filter routes using route param in the appsec middleware config like this in your app's config.json

"middleware": {
     "appsec": {
            "route": "<regex-for-route-selection>"
     }
}

The app sec is an internally defined config in kraken which you can find here https://github.com/krakenjs/kraken-js/blob/v1.0.x/config/config.json#L117-L131 What you are doing above is merging the route param for your apps appsec middleware config.

pvenkatakrishnan avatar Mar 25 '15 19:03 pvenkatakrishnan