LanceGin/Mockman

Bug, suggestions and standards

uniibu opened this issue · 1 comments

Bug

  • The response body does not allow text/string responses. It only allows if it is double quoted. So when you put "ok" on the response, the respond will be the same with quotes. It should basically allow anything with or without quotes.

Suggestion

  • Currently the response's default content-type is set to be application/json, I know most apis responds with this type, but is not always the case. Its ok to have this as default, but i suggest that you automatically add/include it on the headers section, so user knows that it is using application/json content-type.
  • Same with the content-type, if you want to set the Access-Control-Allow-Origin to * then add/include it on the headers section so users knows that it is using it.
  • Allow setting a cookie with specific path, domain, expiry and the option httponly, because currently, the cookies are always set to path=/ domain as localhost http false and empty expiry.
  • Do not allow multiple routes with the same path and same method, as this is redundant and your app will always use the first one declared.
  • Add HEAD method.

Standards

  • According to HTTP Methods GET HEAD OPTIONS do not accept body parameters. So do not allow setting of body parameters for those routes.

If you accept PRs I'd be happy to look into some of them. Cheers!

Edit:

  • Would also be nice to remove the X-Powered-By: Express on the response headers

Bug && Suggestion

in the latest version of Mockman, the response can be default and only set to application/json , the response type will be variety in the future version.

Standard

the HEAD method has been added to the latest version.

btw, of course the PR is welcomed