Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Skip downloading resources from file:// or resource:// #8

Open
groovecoder opened this issue May 21, 2015 · 1 comment
Open

Skip downloading resources from file:// or resource:// #8

groovecoder opened this issue May 21, 2015 · 1 comment

Comments

@groovecoder
Copy link
Contributor

Steps to reproduce:

  1. Include the <script> tag on a page with protocol-relative paths to CSS resources. E.g., <link href="//mozorg.cdn.mozilla.net/media/css/tabzilla-min.css" rel="stylesheet">
  2. Hit the page
  3. Start analysis for the domain

Expected results:
Should see analysis report for the page

Actual results:
Alligator worker shows traceback:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/webalyzer/base/management/commands/run-gator.py", line 14, in handle
    worker.run_forever()
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/alligator/workers.py", line 99, in run_forever
    result = self.gator.pop()
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/alligator/gator.py", line 145, in pop
    return self.execute(task)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/alligator/gator.py", line 215, in execute
    return task.run()
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/alligator/tasks.py", line 250, in run
    result = self.func(*self.func_args, **self.func_kwargs)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/webalyzer/analyzer/views.py", line 171, in start_analysis
    processor.process_html(page.html, page.url)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/mincss/processor.py", line 215, in process_html
    self.blocks[key] = self._download(link_url)
  File "/Users/lcrouch/code/py_sandbox/webalyzer/venv/lib/python2.7/site-packages/mincss/processor.py", line 99, in _download
    raise IOError(url)
IOError: file://mozorg.cdn.mozilla.net/media/css/tabzilla-min.css
@peterbe
Copy link
Contributor

peterbe commented May 22, 2015

This sounds like a bug in mincss.
It should pick up its scheme from the URL of the page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants