forked from apache/trafficserver
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from hnakamur/update_doc_ja_with_master
Update doc-ja branch with upstream/master
- Loading branch information
Showing
2,407 changed files
with
224,386 additions
and
84,845 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "lib/luajit"] | ||
path = lib/luajit | ||
url = http://luajit.org/git/luajit-2.0.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Dummy file to close Github pull requests | ||
TS-4053: 9caf1d5c487120c2140a3127a44f494309700d6f | ||
TS-4057: 59cb070654a6e6a7acdd6509a770478d413f79a6 | ||
fc59a5b9e6512397c3c5cedb3bd7436d7a8a65d1 | ||
bcec70dc84a9a3eefc9a037c5a43e3422d4fc29a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
''' | ||
Test body_factory | ||
''' | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
import requests | ||
import logging | ||
import random | ||
import tsqa.test_cases | ||
import helpers | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class TestDomainSpecificBodyFactory(helpers.EnvironmentCase): | ||
''' | ||
Tests for how body factory works with requests of different domains | ||
''' | ||
@classmethod | ||
def setUpEnv(cls, env): | ||
cls.configs['records.config']['CONFIG'].update({ | ||
'proxy.config.body_factory.enable_customizations': 3, # enable domain specific body factory | ||
}) | ||
cls.configs['remap.config'].add_line( | ||
'map / http://www.linkedin.com/ @action=deny' | ||
) | ||
cls.body_factory_dir = os.path.join(cls.environment.layout.prefix, cls.configs['records.config']['CONFIG']['proxy.config.body_factory.template_sets_dir']) | ||
cls.domain_directory = ['www.linkedin.com', '127.0.0.1', 'www.foobar.net'] | ||
for directory_item in cls.domain_directory: | ||
current_dir = os.path.join(cls.body_factory_dir, directory_item) | ||
try: | ||
os.mkdir(current_dir) | ||
except: | ||
pass | ||
fname = os.path.join(current_dir, "access#denied") | ||
with open(fname, "w") as f: | ||
f.write(directory_item) | ||
fname = os.path.join(current_dir, ".body_factory_info") | ||
with open(fname, "w") as f: | ||
pass | ||
|
||
def test_domain_specific_body_factory(self): | ||
times = 1000 | ||
no_dir_domain = 'www.nodir.com' | ||
self.domain_directory.append(no_dir_domain) | ||
self.assertEqual(4, len(self.domain_directory)) | ||
url = 'http://127.1.0.1:{0}'.format(self.configs['records.config']['CONFIG']['proxy.config.http.server_ports']) | ||
for i in xrange(times): | ||
domain = random.choice(self.domain_directory) | ||
headers = {'Host': domain} | ||
r = requests.get(url, headers=headers) | ||
domain_in_response = no_dir_domain | ||
for domain_item in self.domain_directory: | ||
if domain_item in r.text: | ||
domain_in_response = domain_item | ||
break | ||
self.assertEqual(domain, domain_in_response) |
Oops, something went wrong.