Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
b2b5c268
Unverified
Commit
b2b5c268
authored
Jan 14, 2018
by
Dave Machado
Browse files
Update validate_format script for CORS
parent
368c73b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/validate_format.py
View file @
b2b5c268
...
...
@@ -8,12 +8,14 @@ anchor = '###'
auth_keys
=
[
'apiKey'
,
'OAuth'
,
'X-Mashape-Key'
,
'No'
]
punctuation
=
[
'.'
,
'?'
,
'!'
]
https_keys
=
[
'Yes'
,
'No'
]
cors_keys
=
[
'Yes'
,
'No'
,
'Unknown'
]
index_title
=
0
index_desc
=
1
index_auth
=
2
index_https
=
3
index_link
=
4
index_cors
=
4
index_link
=
5
errors
=
[]
...
...
@@ -91,6 +93,12 @@ def check_format(filename):
if
https
not
in
https_keys
:
add_error
(
line_num
,
"{} is not a valid HTTPS option"
.
format
(
https
))
# END HTTPS
# START CORS
# values should conform to valid options only
cors
=
segments
[
index_cors
]
if
cors
not
in
cors_keys
:
add_error
(
line_num
,
"{} is not a valid CORS option"
.
format
(
cors
))
# END CORS
# START Link
# url should be wrapped in '[Go!]()' Markdown syntax
link
=
segments
[
index_link
]
...
...
Write
Preview
Supports
Markdown
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