codegram / rack-webconsole

Rack-based interactive console (à la Rails console) for your web application's front-end
http://codegram.github.com/rack-webconsole
250 stars 50 forks source link

Console functionality problem #30

Open vvatikiotis opened 13 years ago

vvatikiotis commented 13 years ago

with gem version 0.1.2 on a linux chromium 12.0.742.112.

The console opens up ok (backtic). I can insert chars in the CLI, but the enter key is ignored and the console view is always blank.

oriolgual commented 13 years ago

Could you check if that is still happening using rack-webconsole from master?

vvatikiotis commented 13 years ago

same problem. Same versions. Also using bundler 1.0.12, sinatra 1.2.6 and rack 1.3.2, rack-webconsole from master.

Gemfile: gem "redis" gem "SystemTimer", "1.2.3" # redis requires this gem "sinatra", "1.2.6" gem "activesupport", "3.0.5" # XML <-> JSON gem "i18n" gem "json" gem "builder" gem "nokogiri" # xpath gem "dm-core", "1.1.0" gem "dm-migrations", "1.1.0"

group :development, :test do gem "shotgun" gem "ruby-debug" gem 'rack-webconsole', :git => 'https://github.com/codegram/rack-webconsole.git' gem 'rack-test' gem "capybara" gem 'launchy' # capybara's save_and_open_page requires this gem 'factory_girl' gem 'rspec', '2.5' gem 'rspec-core', '2.5.2' gem "ZenTest", '4.6' gem 'autotest' gem "autotest-inotify" gem "mysql2" gem "dm-mysql-adapter", "1.1.0" end

config.ru require 'lib/myprox' if Sinatra::Base.development? require 'rack/webconsole' use Rack::Webconsole Rack::Webconsole.inject_jquery = true end

run MyProx

vvatikiotis commented 13 years ago

I had a quick look, no spec yet, I have to work on it (me newb)

In Repl#call : return [status, headers, response] unless check_legitimate(req)

The above always returns. Repl.token is always nil even if req.params['token'] is not. Where do you set Repl.token ?

vvatikiotis commented 13 years ago

sorry closed it by accident

vvatikiotis commented 13 years ago

when the console is active and each time input is passed in the form, Repl is re-initialised, thus token = nil

vvatikiotis commented 13 years ago

I've tracked it down to the ajax call which sends the token and the user query. unfortunately my javascript knowledge is nil...

So whenever there is the ajax POST at /webconsole, env['QUERY_STRING') is empty. the user query and the token aren't passed in the call.

I've used the query injection method and the standard way i.e. download and load jquery in my html. No joy.

vvatikiotis commented 13 years ago

This is similar to bug #22. When I invoke shotgun I get a 404. rackup works as expected.

txus commented 12 years ago

Any updates / further insight on this?

txus commented 10 years ago

@vvatikiotis any updates?