Extend form-action policies for Chrome
It seems that unlike other browsers Chrome requires that if a form submission redirects that the redirected URL also match the form-action policy rather than just requiring the original URL to match.
This commit is contained in:
parent
a3519348c6
commit
986779966b
3 changed files with 7 additions and 0 deletions
|
@ -415,6 +415,7 @@ class ApplicationController < ActionController::Base
|
|||
append_content_security_policy_directives(
|
||||
:child_src => %w[127.0.0.1:8111 127.0.0.1:8112],
|
||||
:connect_src => %w[nominatim.openstreetmap.org overpass-api.de router.project-osrm.org valhalla.mapzen.com],
|
||||
:form_action => %w[render.openstreetmap.org],
|
||||
:script_src => %w[graphhopper.com open.mapquestapi.com],
|
||||
:img_src => %w[developer.mapquest.com]
|
||||
)
|
||||
|
|
|
@ -38,6 +38,8 @@ class OauthController < ApplicationController
|
|||
protected
|
||||
|
||||
def oauth1_authorize
|
||||
append_content_security_policy_directives(:form_action => %w[*])
|
||||
|
||||
if @token.invalidated?
|
||||
@message = t "oauth.oauthorize_failure.invalid"
|
||||
render :action => "authorize_failure"
|
||||
|
|
|
@ -203,6 +203,10 @@ class UserController < ApplicationController
|
|||
@title = t "user.new.title"
|
||||
@referer = params[:referer] || session[:referer]
|
||||
|
||||
append_content_security_policy_directives(
|
||||
:form_action => %w[accounts.google.com *.facebook.com login.live.com github.com meta.wikimedia.org]
|
||||
)
|
||||
|
||||
if current_user
|
||||
# The user is logged in already, so don't show them the signup
|
||||
# page, instead send them to the home page
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue