Tuesday, January 02, 2007

Stop Google Web Accelerator in your Rails apps

Use the following code to stop Google Web Accelerator in your Rails apps


class ApplicationController < ActionController::Base
before_filter :disable_link_prefetching

private
def disable_link_prefetching
if request.env["HTTP_X_MOZ"] == "prefetch"
logger.debug "prefetch detected: sending 403 Forbidden"
render_nothing "403 Forbidden"
return false
end
end
end

1 comments:

vidyasru said...

see these famous ebooks sites

www.way2books.com

www.ebooksrar.com

for your all ebook needs

thank you