buunguyen / koa-req-validator

Declarative request validation middleware for Koa
MIT License
19 stars 11 forks source link

Validation with header as another scope #6

Closed knife-s closed 5 years ago

knife-s commented 6 years ago

Hello, I need to validate a header in the request with certain value, can you please add support for headers? I did it but I lost my changes everytime I wrote npm install.

Thank you, this is a very useful module!

ngphi commented 6 years ago

Hi @knife-s ,

It's a good idea. Could you give me some use cases ? How did you implement the feature in your local ?

It would be helpful for me to start implementing the feature.

knife-s commented 5 years ago

Hi @knife-s ,

It's a good idea. Could you give me some use cases ? How did you implement the feature in your local ?

It would be helpful for me to start implementing the feature.

Sorry for late reply.

One useful use-case would be when You need to validate a custom header such as "X-custom-Token: xxxx" to return custom data based on it.

buunguyen commented 5 years ago

Header validation is already support (thanks to @nphi1212).