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

using delete as HTTP method name in routeConfig crashes the process #2

Closed
Thesephi opened this issue Dec 23, 2018 · 3 comments
Closed

Comments

@Thesephi
Copy link
Member

Consider the following routeConfig:

{
  'delete /item/:id' : handler
}

Expected: the route gets registered and the framework behaves as such
Actual: the whole process is crashed with a cryptic error message:

TypeError: c[i] is not a function

Reason is that the underlying restify server only recognizes del as the method name, not delete. This happens also when there's a capitalization mismatch (e.g. Get vs get or PUT vs put). We'll probably want to normalize all verbs before feeding to restify.

@Thesephi Thesephi pinned this issue Dec 23, 2018
@Thesephi Thesephi added this to the 3.1.0 milestone Dec 23, 2018
@Thesephi
Copy link
Member Author

Thesephi commented Dec 27, 2018

Related: using an invalid route signature such as /some-path (no method name before) as opposed to get /some-path also crashes the process with a cryptic error message. We probably wanna throw a user-understandable error instead.

@Thesephi
Copy link
Member Author

Related: using an invalid route signature such as /get some-path (the slash is put before the verb instead of before the path) also crashes the process. Again, a nicely formatted error / warning message would be awesome.

@Thesephi Thesephi removed this from the 3.1.0 milestone Jul 26, 2020
@Thesephi
Copy link
Member Author

Addressed in v8

Thesephi added a commit that referenced this issue Jul 26, 2020
@Thesephi Thesephi unpinned this issue Aug 3, 2020
@Thesephi Thesephi pinned this issue Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant