question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hanging requests (in browser) with invalid payloads.

See original GitHub issue

Cool 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Aug 11, 2019

You’re right, 400 is better than 404 here.

Done and wildcard@0.5.2 now returns 400.

Thanks for opening the issue & let me know if you run into any problem.

1reaction
brilloutcommented, Aug 9, 2019

Cool little project!

Thanks!

So, if you visit /wildcard/hello in the browser then you’ll get a 500 + a stack trace etc. printed, seems good so far.

Yes that’s expected because your endpoint function throws an error when trying to access payload.name while payload is undefined.

why the object is within an array in the URL?

Because it’s the list of arguments, thus an array. Imagine you’d call endpoints.hello('firstArg', 'secondArg').

request hangs indefinitely,

I just published a new version wildcard@0.5.1 that returns a 404 instead of a 500 when calling a malformatted URL such as /wildcard/hello/foo. Your request won’t hang indefinitely anymore.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found