Skip to content

Commit 0b4d33c

Browse files
committed
RDAP conforms February 2024 gTLD RDAP profile
1 parent df84e14 commit 0b4d33c

4 files changed

Lines changed: 107 additions & 36 deletions

File tree

INSTALL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ server {
137137
proxy_set_header Host $host;
138138
proxy_set_header X-Real-IP $remote_addr;
139139
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
140+
141+
# Add CORS headers
142+
add_header Access-Control-Allow-Origin "*";
143+
add_header Access-Control-Allow-Methods "GET, OPTIONS";
144+
add_header Access-Control-Allow-Headers "Content-Type";
140145
}
141146
}
142147

@@ -154,6 +159,11 @@ server {
154159
proxy_set_header Host $host;
155160
proxy_set_header X-Real-IP $remote_addr;
156161
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
162+
163+
# Add CORS headers
164+
add_header Access-Control-Allow-Origin "*";
165+
add_header Access-Control-Allow-Methods "GET, OPTIONS";
166+
add_header Access-Control-Allow-Headers "Content-Type";
157167
}
158168
}
159169
```

install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ server {
180180
proxy_set_header Host \$host;
181181
proxy_set_header X-Real-IP \$remote_addr;
182182
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
183+
184+
# Add CORS headers
185+
add_header Access-Control-Allow-Origin "*";
186+
add_header Access-Control-Allow-Methods "GET, OPTIONS";
187+
add_header Access-Control-Allow-Headers "Content-Type";
183188
}
184189
}
185190
@@ -197,6 +202,11 @@ server {
197202
proxy_set_header Host \$host;
198203
proxy_set_header X-Real-IP \$remote_addr;
199204
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
205+
206+
# Add CORS headers
207+
add_header Access-Control-Allow-Origin "*";
208+
add_header Access-Control-Allow-Methods "GET, OPTIONS";
209+
add_header Access-Control-Allow-Headers "Content-Type";
200210
}
201211
}
202212
EOL

rdap/helpers.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ function mapContactToVCard($contactDetails, $role, $c) {
4646

4747
return [
4848
'objectClassName' => 'entity',
49-
'handle' => [$contactDetails['registrant_contact_id']],
49+
'handle' => $contactDetails['registrant_contact_id'],
5050
'roles' => [$role],
5151
'vcardArray' => [
5252
"vcard",
5353
[
5454
['version', new stdClass(), 'text', '4.0'],
5555
["fn", new stdClass(), 'text', $c['privacy'] ? $redacted : $contactDetails['contact_first_name'] . ' ' . $contactDetails['contact_last_name']],
5656
["org", new stdClass(), 'text', $c['privacy'] ? $redacted : $contactDetails['contact_company']],
57-
["adr", new stdClass(), 'text', [
58-
"", // Post office box
57+
["adr", ["CC" => strtoupper($contactDetails['contact_country'])], 'text', [
5958
$c['privacy'] ? $redacted : $contactDetails['contact_address1'], // Extended address
6059
$c['privacy'] ? $redacted : $contactDetails['contact_address2'], // Street address
61-
$c['privacy'] ? $redacted : $contactDetails['contact_city'], // Locality
62-
$c['privacy'] ? $redacted : $contactDetails['contact_state'], // Region
63-
$c['privacy'] ? $redacted : $contactDetails['contact_postcode'], // Postal code
64-
$c['privacy'] ? $redacted : strtoupper($contactDetails['contact_country']) // Country name
60+
$c['privacy'] ? $redacted : $contactDetails['contact_city'], // Locality
61+
$c['privacy'] ? $redacted : $contactDetails['contact_state'], // Region
62+
$c['privacy'] ? $redacted : $contactDetails['contact_postcode'], // Postal code
63+
$c['privacy'] ? $redacted : strtoupper($contactDetails['contact_country']), // Country name
64+
"" // Required empty last element
6565
]],
66-
["tel", new stdClass(), 'text', $c['privacy'] ? $redacted : $contactDetails['contact_phone_cc'] . '.' . $contactDetails['contact_phone'], ["type" => "voice"]],
67-
["tel", new stdClass(), 'text', $c['privacy'] ? $redacted : $contactDetails['fax'], ["type" => "fax"]],
66+
["tel", ["type" => "voice"], 'text', $c['privacy'] ? $redacted : $contactDetails['contact_phone_cc'] . '.' . $contactDetails['contact_phone']],
67+
["tel", ["type" => "fax"], 'text', $c['privacy'] ? $redacted : $contactDetails['fax']],
6868
["email", new stdClass(), 'text', $c['privacy'] ? $redacted : $contactDetails['contact_email']]
6969
]
7070
],

0 commit comments

Comments
 (0)