Links to external websites should not be locked down

Added by Anonymous 203 days ago

Link to other websites are being locked down and since there's no way to specify external websites as being public, I think
link_to "Google", "http://www.google.com"
Should be left alone.


Replies

RE: Links to external websites should not be locked down - Added by Andrew Stone 203 days ago

Just released 0.5.8 to address this issue.

thanks,
andy

RE: Links to external websites should not be locked down - Added by Anonymous 201 days ago

I don't know why, but these links
http://www.helium.com/items/558848-mileage-classic-properly-maintained
http://www.forbes.com/energy/2008/06/18/honeywell-renewable-resources-tech-sciences-cx_stc_0618honeywell.html?feed=rss_business_energy
are giving me problems

here's my stack trace:
"bad URI: http://www.forbes.com/energy/2008/06/18/honeywell-renewable-resources-tech-sciences-cx_stc_0618honeywell.html?feed=rss_business_energy "
On line #13 of renders/_feeds.html.erb

10: <h3><%= day.strftime('%B %d, %Y') %></h3>
11: <ul>
12: <% for feed in feeds_grouped %>
13: <%= render_feed_hlp(feed) %>
14: <% end %>
15: </ul>
16: <% end %>

/opt/local/lib/ruby/1.8/uri/common.rb:436:in `split'
/opt/local/lib/ruby/gems/1.8/gems/lockdown-0.5.8/lib/lockdown/controller.rb:165:in `authorized?'
(eval):2:in `send'
(eval):2:in `authorized?'
/opt/local/lib/ruby/gems/1.8/gems/lockdown-0.5.8/lib/lockdown/view.rb:44:in `link_to'
app/helpers/renders_helper.rb:16:in `render_feed_hlp'
app/views/renders/_feeds.html.erb:13:in `_run_erb_47app47views47renders47_feeds46html46erb'
app/views/renders/_feeds.html.erb:12:in `each'
app/views/renders/_feeds.html.erb:12:in `_run_erb_47app47views47renders47_feeds46html46erb'
app/views/renders/_feeds.html.erb:9:in `each'
app/views/renders/_feeds.html.erb:9:in `_run_erb_47app47views47renders47_feeds46html46erb'
vendor/rails/actionpack/lib/action_view/base.rb:338:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:338:in `execute'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `send'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `render'
vendor/rails/actionpack/lib/action_view/partial_template.rb:20:in `render'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:30:in `benchmark'
vendor/rails/actionpack/lib/action_view/partial_template.rb:19:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:22:in `render_template'
vendor/rails/actionpack/lib/action_view/partials.rb:110:in `render_partial'
vendor/rails/actionpack/lib/action_view/base.rb:273:in `render'
app/views/renders/news.html.erb:11:in `_run_erb_47app47views47renders47news46html46erb'
vendor/rails/actionpack/lib/action_view/base.rb:338:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:338:in `execute'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `send'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:35:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:22:in `render_template'
vendor/rails/actionpack/lib/action_view/base.rb:245:in `render_file'
vendor/rails/actionpack/lib/action_controller/base.rb:1108:in `render_for_file'
vendor/rails/actionpack/lib/action_controller/base.rb:841:in `render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/layout.rb:251:in `render_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:8:in `realtime'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
vendor/rails/actionpack/lib/action_controller/base.rb:1157:in `default_render'
vendor/rails/actionpack/lib/action_controller/base.rb:1163:in `perform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:580:in `call_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:529:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:529:in `process_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:130:in `process'
vendor/rails/actionpack/lib/action_controller/base.rb:389:in `process'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in `handle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in `process'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `synchronize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `process'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/opt/local/bin/mongrel_rails:19:in `load'
/opt/local/bin/mongrel_rails:19

RE: Links to external websites should not be locked down - Added by Andrew Stone 201 days ago

Thanks for this great information. I'll check it out this afternoon.

I really appreciate this feedback,
andy

RE: Links to external websites should not be locked down - Added by Andrew Stone 201 days ago

I couldn't replicate the issue with the url posted...until i added a space at the end. So I'll add a strip call to the url to account for this issue.

RE: Links to external websites should not be locked down - Added by Anonymous 200 days ago

Ah! That must be it then! I was wondering why the behavior was inconsistent! Sweet!
Thanks. It's from feeds that I'm pulling... I suppose I should be doing the same.

Do you know the best way to sanitize outputs?
Or are you more about sanitizing inputs?

Thanks Andy
and I really appreciate this gem. It seriously is a lifesaver for me.

RE: Links to external websites should not be locked down - Added by Andrew Stone 200 days ago

You are very welcome, I happy to hear you find it useful.

I'm not sure I understand the question regarding sanitizing outputs.

From my perspective, Lockdown should be able to handle anything given to it without blowing up. In this case (space issue), Lockdown should have processed it without issue and you shouldn't have to sanitize it.

It wouldn't be very efficient to sanitize it multiple times.