diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-10 20:41:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-10 20:41:18 +0000 |
commit | 14d2af20ed388dc30da7cc103584b0229e0edb62 (patch) | |
tree | b8eea54390428ecd2a2f9b1568d42bbf9516a47d /lib | |
parent | b69a74a63d5508767cd8b6ea5d1c966de0ee07fd (diff) | |
download | gitlab-ce-14d2af20ed388dc30da7cc103584b0229e0edb62.tar.gz |
Add latest changes from gitlab-org/security/gitlab@14-6-stable-ee
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/legacy_github_import/client.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/url_blocker.rb | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/legacy_github_import/client.rb b/lib/gitlab/legacy_github_import/client.rb index 48a8e0ce6d7..7a9dae3a3de 100644 --- a/lib/gitlab/legacy_github_import/client.rb +++ b/lib/gitlab/legacy_github_import/client.rb @@ -48,10 +48,11 @@ module Gitlab ) end - def authorize_url(redirect_uri) + def authorize_url(redirect_uri, state = nil) client.auth_code.authorize_url({ redirect_uri: redirect_uri, - scope: "repo, user, user:email" + scope: "repo, user, user:email", + state: state }) end diff --git a/lib/gitlab/url_blocker.rb b/lib/gitlab/url_blocker.rb index 2c5d76ba41d..f092e03046a 100644 --- a/lib/gitlab/url_blocker.rb +++ b/lib/gitlab/url_blocker.rb @@ -252,13 +252,13 @@ module Gitlab def internal_web?(uri) uri.scheme == config.gitlab.protocol && uri.hostname == config.gitlab.host && - (uri.port.blank? || uri.port == config.gitlab.port) + get_port(uri) == config.gitlab.port end def internal_shell?(uri) uri.scheme == 'ssh' && uri.hostname == config.gitlab_shell.ssh_host && - (uri.port.blank? || uri.port == config.gitlab_shell.ssh_port) + get_port(uri) == config.gitlab_shell.ssh_port end def domain_allowed?(uri) |