static-import.py (409B)
1 # This file needs to be a sibling of the test files (and not under resources/) 2 # so that base URL resolution is the same between those test files and <script>s 3 # pointing to this file. 4 5 from wptserve.utils import isomorphic_decode 6 7 def main(request, response): 8 return ( 9 ((b'Content-Type', b'text/javascript'),), 10 u'import "{}";\n'.format(isomorphic_decode(request.GET.first(b'url'))) 11 )