зеркало из https://github.com/microsoft/clang-1.git
Add scan-view '--allow-all-hosts' option, by default access is now
restricted to 127.0.0.1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
3b38e45779
Коммит
f6a415fe47
|
@ -492,6 +492,10 @@ File Bug</h3>
|
||||||
return self.send_string(result)
|
return self.send_string(result)
|
||||||
|
|
||||||
def send_head(self, fields=None):
|
def send_head(self, fields=None):
|
||||||
|
if (self.server.options.onlyServeLocal and
|
||||||
|
self.client_address[0] != '127.0.0.1'):
|
||||||
|
return self.send_error('401', 'Unauthorized host.')
|
||||||
|
|
||||||
if fields is None:
|
if fields is None:
|
||||||
fields = {}
|
fields = {}
|
||||||
self.fields = fields
|
self.fields = fields
|
||||||
|
|
|
@ -93,6 +93,9 @@ def main():
|
||||||
parser.add_option("--no-browser", dest="startBrowser", default=True,
|
parser.add_option("--no-browser", dest="startBrowser", default=True,
|
||||||
action="store_false",
|
action="store_false",
|
||||||
help="Don't open a webbrowser on startup.")
|
help="Don't open a webbrowser on startup.")
|
||||||
|
parser.add_option("--allow-all-hosts", dest="onlyServeLocal", default=True,
|
||||||
|
action="store_false",
|
||||||
|
help='Allow connections from any host (access restricted to "127.0.0.1" by default)')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче