Skip to content

Commit

Permalink
Merge pull request #2593 from kritisingh1/subpath
Browse files Browse the repository at this point in the history
Fixes #2587 - Adds subpath parameter to the wellknown function
  • Loading branch information
karlcow authored Sep 24, 2018
2 parents 9c6779d + 45d43aa commit b1259f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions tests/unit/test_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,12 @@ def test_form_rendering(self):
self.assertTrue('Mac OS X 10.13' in rv.data)
self.assertTrue('http://example.com/' in rv.data)

def test_wellknown_subpath(self):
"""Test that the /.wellknown/subpath route gets 404."""
rv = self.app.get('/.well-known/test-route')
expected = 'test-route'
self.assertEqual(rv.status_code, 404)
self.assertTrue(expected in rv.data)

if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion tests/unit/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_csp_report_uri_bad_content_type(self):
self.assertEqual(rv.status_code, 400)

def test_tools_cssfixme(self):
"""Test that the /tools/cssfixme route gets 200."""
"""Test that the /tools/cssfixme route gets 410."""
rv = self.app.get('/tools/cssfixme')
self.assertEqual(rv.status_code, 410)

Expand Down
2 changes: 1 addition & 1 deletion webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def log_csp_report():

@app.route('/.well-known/<path:subpath>')
@cache_policy(private=False, uri_max_age=31104000, must_revalidate=False)
def wellknown():
def wellknown(subpath):
"""Route for returning 404 for the currently unused well-known routes."""
msg = """
Sorry dear bot,
Expand Down

0 comments on commit b1259f3

Please sign in to comment.