[GH-ISSUE #30] Stuck/slow OPTIONS response when no body #30

Closed
opened 2026-03-02 23:01:52 +03:00 by kerem · 1 comment
Owner

Originally created by @natanavra on GitHub (Oct 25, 2020).
Original GitHub issue: https://github.com/agrinman/tunnelto/issues/30

Noticed when using Tunnelto.dev with a nodejs/express app and returning an empty response for OPTIONs request results in very long request time (20-60 seconds), it works eventually but very slow to work with and test.
Here's how I used to handle OPTIONS:

if(req.method === 'OPTIONS') {
  return res.status(200).end();
}

Once I changed the response to have a body, tunnelto.dev started handling it much faster:

if(req.method === 'OPTIONS') {
  // add some check if it's tunnelto.dev (check headers.origin or headers.referer)
  return res.send({ success: true }).end();
}
Originally created by @natanavra on GitHub (Oct 25, 2020). Original GitHub issue: https://github.com/agrinman/tunnelto/issues/30 Noticed when using Tunnelto.dev with a nodejs/express app and returning an empty response for OPTIONs request results in very long request time (20-60 seconds), it works eventually but very slow to work with and test. Here's how I used to handle OPTIONS: ```js if(req.method === 'OPTIONS') { return res.status(200).end(); } ``` Once I changed the response to have a body, tunnelto.dev started handling it much faster: ```js if(req.method === 'OPTIONS') { // add some check if it's tunnelto.dev (check headers.origin or headers.referer) return res.send({ success: true }).end(); } ```
kerem 2026-03-02 23:01:52 +03:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@agrinman commented on GitHub (Apr 18, 2021):

#37

<!-- gh-comment-id:822012786 --> @agrinman commented on GitHub (Apr 18, 2021): #37
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tunnelto#30
No description provided.