Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug, suggestions and standards #4

Open
uniibu opened this issue Oct 19, 2018 · 1 comment
Open

Bug, suggestions and standards #4

uniibu opened this issue Oct 19, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@uniibu
Copy link

uniibu commented Oct 19, 2018

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
@LanceGin
Copy link
Owner

LanceGin commented Nov 3, 2018

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

@LanceGin LanceGin added the enhancement New feature or request label Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants