Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
29d445eb
Commit
29d445eb
authored
Dec 16, 2021
by
Jason Plum
Committed by
Heinrich Lee Yu
Dec 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VerifyPagesDomain: suffix with . indicate absolute fqdn
parent
ffe18959
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/services/verify_pages_domain_service.rb
app/services/verify_pages_domain_service.rb
+2
-1
spec/services/verify_pages_domain_service_spec.rb
spec/services/verify_pages_domain_service_spec.rb
+2
-1
No files found.
app/services/verify_pages_domain_service.rb
View file @
29d445eb
...
...
@@ -85,7 +85,8 @@ class VerifyPagesDomainService < BaseService
end
def
check
(
domain_name
,
resolver
)
records
=
parse
(
txt_records
(
domain_name
,
resolver
))
# Append '.' to domain_name, indicating absolute FQDN
records
=
parse
(
txt_records
(
domain_name
+
'.'
,
resolver
))
records
.
any?
do
|
record
|
record
==
domain
.
keyed_verification_code
||
record
==
domain
.
verification_code
...
...
spec/services/verify_pages_domain_service_spec.rb
View file @
29d445eb
...
...
@@ -372,7 +372,8 @@ RSpec.describe VerifyPagesDomainService do
allow
(
resolver
).
to
receive
(
:getresources
)
{
[]
}
stubbed_lookups
.
each
do
|
domain
,
records
|
records
=
Array
(
records
).
map
{
|
txt
|
Resolv
::
DNS
::
Resource
::
IN
::
TXT
.
new
(
txt
)
}
allow
(
resolver
).
to
receive
(
:getresources
).
with
(
domain
,
Resolv
::
DNS
::
Resource
::
IN
::
TXT
)
{
records
}
# Append '.' to domain_name, indicating absolute FQDN
allow
(
resolver
).
to
receive
(
:getresources
).
with
(
domain
+
'.'
,
Resolv
::
DNS
::
Resource
::
IN
::
TXT
)
{
records
}
end
resolver
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment