Skip to content

Commit

Permalink
Merge pull request #7 from w3c/jgraham/file_sub
Browse files Browse the repository at this point in the history
Use substitutions on files with a .sub.* extension
  • Loading branch information
jgraham committed Feb 27, 2014
2 parents 688a73b + 06f950e commit 5017d06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wptserve/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ def __call__(self, request, response):
data = self.get_data(response, path, byte_ranges)
response.content = data
query = urlparse.parse_qs(request.url_parts.query)

pipeline = None
if "pipe" in query:
pipeline = Pipeline(query["pipe"][-1])
elif os.path.splitext(path)[0].endswith(".sub"):
pipeline = Pipeline("sub")
if pipeline is not None:
response = pipeline(request, response)

return response
Expand Down

0 comments on commit 5017d06

Please sign in to comment.