Hanging requests (in browser) with invalid payloads.
See original GitHub issueCool little project!
Create a basic endpoint e.g. mine is:
endpoints.hello = function(payload) {
return {
message: `Welcome ${payload.name}!`
};
};
So, if you visit /wildcard/hello
in the browser then you’ll get a 500
+ a stack trace etc. printed, seems good so far.
If you visit e.g. /wildcard/hello/%5B%7B%22name%22%3A%22Alice%22%7D%5D
then you get a 200
+ the API response, also seems good (although I don’t understand why the object is within an array in the URL?
However if you visit e.g. /wildcard/hello/foo
then the request hangs indefinitely, as far as I can tell and you get this error server-side:
ReferenceError: endpointArgsString is not defined
at parseRequest (.../wildcard-test/node_modules/wildcard-api/server/WildcardApi.js:136:36)
at getApiResponse (.../wildcard-test/node_modules/wildcard-api/server/WildcardApi.js:53:71)
Maybe this isn’t really a bug but you would expect it to not hang indefinitely, that seems bad?
Note that I’m using this with Express.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Request intercept ContinueAsync(Payload) hanging #616
I am trying to get a POST request working, but am getting navigation timeouts anytime a Payload is passed to Request.ContinueAsync.
Read more >When does a browser send HTTP payload separately from the ...
Because the server uses a naive implementation of HTTP, it only inspects the first packet of an HTTP request, and misses the arguments...
Read more >Can't get HTTP payload modification iRule to work DevCentral
Upon changing the rule, the first request to the virtual server hangs, and all other requests will hang, until the first request is...
Read more >What would cause XMLHttpRequest to hang without error until ...
An XMLHttpRequest timeout ProgressEvent is dispatched if: The author specified timeout has passed before the fetch completed.
Read more >400 Bad request - plain HTTP request sent to HTTPS port
This error occurs when a client is trying to connect to an API on Apigee and the mentioned virtual host is configured to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re right,
400
is better than404
here.Done and
wildcard@0.5.2
now returns400
.Thanks for opening the issue & let me know if you run into any problem.
Thanks!
Yes that’s expected because your endpoint function throws an error when trying to access
payload.name
whilepayload
isundefined
.Because it’s the list of arguments, thus an array. Imagine you’d call
endpoints.hello('firstArg', 'secondArg')
.I just published a new version
wildcard@0.5.1
that returns a404
instead of a500
when calling a malformatted URL such as/wildcard/hello/foo
. Your request won’t hang indefinitely anymore.