pnxtech / hydra-express

A module which wraps Hydra and ExpressJS into a library for building distributed applications - such as microservices
MIT License
184 stars 38 forks source link

HTTP-StatusCode 403 #86

Closed lfroe closed 7 years ago

lfroe commented 7 years ago

It seems that hydra can't handle the HTTP-StatusCode 403. Whenever I try to send this status it defaults to 503, which means the service is unavailable (which is not true). The reason for this seems to be that the key '403' doesn't exist in the ServerResponse.STATUS-object in the server-response.js-file. Therefore the createResponseObject function throws an error (because it tries to access the object at a key that does not exist) and the response defaults to 503 in the catch-block of _tryAPIRequest.

Is there any workaround for this?

drosi94 commented 7 years ago

Try to use 401 as workaround

cjus commented 7 years ago

@lfroe Will be reviewing your PR for this today. Thanks for that.

cjus commented 7 years ago

@lfroe I added an entry for HTTP 403 and your patch for any missing status codes. Please try hydra@1.4.8-experimental.3 or hydra-express@1.4.8-experimental.5

cjus commented 7 years ago

This is now present in hydra@1.4.8 and hydra-express@1.4.8.