[GH-ISSUE #37] Header-only responses faulty #34

Closed
opened 2026-03-02 23:01:54 +03:00 by kerem · 5 comments
Owner

Originally created by @airblade on GitHub (Mar 12, 2021).
Original GitHub issue: https://github.com/agrinman/tunnelto/issues/37

I have an endpoint that returns a header-only 200 OK response; there is no body.

It's generated using Rails's head :ok method (here).

When I hit this endpoint with curl via tunnelto, the response does not seem to make it back out of the tunnel to me. curl hangs, and eventually stops itself with:

curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

If I change my endpoint to return a 200 OK response with a non-empty body, everything works as expected.

In both cases the Request Inspector shows a 200 response being sent straightaway – but the header-only one seems to get lost in the tunnel.

This happens with both GET and POSTs. Not sure if it is related to #30.

I'm using tunnelto 0.1.12.

Originally created by @airblade on GitHub (Mar 12, 2021). Original GitHub issue: https://github.com/agrinman/tunnelto/issues/37 I have an endpoint that returns a header-only 200 OK response; there is no body. It's generated using Rails's `head :ok` method ([here](https://github.com/rails/rails/blob/5aaaa1630ae9a71b3c3ecc4dc46074d678c08d67/actionpack/lib/action_controller/metal/head.rb#L21)). When I hit this endpoint with curl via tunnelto, the response does not seem to make it back out of the tunnel to me. curl hangs, and eventually stops itself with: curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) If I change my endpoint to return a 200 OK response with a non-empty body, everything works as expected. In both cases the Request Inspector shows a 200 response being sent straightaway – but the header-only one seems to get lost in the tunnel. This happens with both GET and POSTs. Not sure if it is related to #30. I'm using tunnelto 0.1.12.
kerem closed this issue 2026-03-02 23:01:54 +03:00
Author
Owner

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

hey there, I just tried to repro this and it's not erroring for me. can you give it another go? the latest version is 1.1.14

<!-- gh-comment-id:822012165 --> @agrinman commented on GitHub (Apr 18, 2021): hey there, I just tried to repro this and it's not erroring for me. can you give it another go? the latest version is 1.1.14
Author
Owner

@airblade commented on GitHub (Apr 19, 2021):

I tried again with tunnelto 0.1.14 and had the same problem as before.

I'm using curl 7.54.0 on macOS 10.14.6. I'm using the Catalina release of tunnelto from the releases page (I first tried to install it via Homebrew but the Rust build process pegged all my cores at close to 100% and after a while I killed the process).

<!-- gh-comment-id:822601087 --> @airblade commented on GitHub (Apr 19, 2021): I tried again with tunnelto 0.1.14 and had the same problem as before. I'm using curl 7.54.0 on macOS 10.14.6. I'm using the Catalina release of tunnelto from the releases page (I first tried to install it via Homebrew but the Rust build process pegged all my cores at close to 100% and after a while I killed the process).
Author
Owner

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

I tried again with tunnelto 0.1.14 and had the same problem as before.

do you have a sample rails server function i can try to reproduce locally?

I'm using curl 7.54.0 on macOS 10.14.6. I'm using the Catalina release of tunnelto from the releases page (I first tried to install it via Homebrew but the Rust build process pegged all my cores at close to 100% and after a while I killed the process).

brew should also be able to install the bottled version of it, so it wont need rust

<!-- gh-comment-id:822778436 --> @agrinman commented on GitHub (Apr 19, 2021): > I tried again with tunnelto 0.1.14 and had the same problem as before. do you have a sample rails server function i can try to reproduce locally? > I'm using curl 7.54.0 on macOS 10.14.6. I'm using the Catalina release of tunnelto from the releases page (I first tried to install it via Homebrew but the Rust build process pegged all my cores at close to 100% and after a while I killed the process). brew should also be able to install the bottled version of it, so it wont need rust
Author
Owner

@airblade commented on GitHub (Apr 20, 2021):

brew should also be able to install the bottled version of it

How do I get brew to do that?

Anyway, using this single-file Rails app:

# app.ru
require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"
  gem "rails"
  gem 'rack'
end

require 'rails'
require "action_controller/railtie"

class TestApp < Rails::Application
  config.root = __dir__
  config.hosts << "issue37.tunnelto.dev"
  secrets.secret_key_base = "secret_key_base"

  config.logger = Logger.new($stdout)
  Rails.logger  = config.logger

  routes.draw do
    get "/" => "test#index"
  end
end

class TestController < ActionController::Base
  def index
    # render plain: "Hello"
    head :ok
  end
end

run TestApp

...and running it via rackup app.ru -p 8000;
...and launching tunnelto with tunnelto -s issue37;
...and hitting the endpoint with curl -i https://issue37.tunnelto.dev;

...I can't reproduce the problem.

Hmm, there must be something about my real Rails app which is causing curl to hang. Weird. OK, well it looks like tunnelto is doing exactly what it should :)

<!-- gh-comment-id:823165044 --> @airblade commented on GitHub (Apr 20, 2021): > brew should also be able to install the bottled version of it How do I get brew to do that? Anyway, using this single-file Rails app: ```ruby # app.ru require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "rails" gem 'rack' end require 'rails' require "action_controller/railtie" class TestApp < Rails::Application config.root = __dir__ config.hosts << "issue37.tunnelto.dev" secrets.secret_key_base = "secret_key_base" config.logger = Logger.new($stdout) Rails.logger = config.logger routes.draw do get "/" => "test#index" end end class TestController < ActionController::Base def index # render plain: "Hello" head :ok end end run TestApp ``` ...and running it via `rackup app.ru -p 8000`; ...and launching tunnelto with `tunnelto -s issue37`; ...and hitting the endpoint with `curl -i https://issue37.tunnelto.dev`; ...I can't reproduce the problem. Hmm, there must be something about my real Rails app which is causing curl to hang. Weird. OK, well it looks like tunnelto is doing exactly what it should :)
Author
Owner

@mrudult commented on GitHub (Mar 24, 2022):

For me, it stuck on OPTIONS request. Works fine with ngrok.

<!-- gh-comment-id:1077593014 --> @mrudult commented on GitHub (Mar 24, 2022): For me, it stuck on OPTIONS request. Works fine with ngrok.
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#34
No description provided.