Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handling unsupported content #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

starrify
Copy link
Member

For now I cannot think of a good design for returning the downloaded unsupported content back to the client via existing endpoints (e.g. /html, /png, and /har). The good news:

  1. The server won't hang and return a 504 timeout error now.
  2. At least the /har endpoint now works as expected.

Maybe later we can introduce something like splash:raw_content in the scripting support to deliver the content.

@starrify starrify force-pushed the fix-issue-91 branch 4 times, most recently from 8365c7f to 0071e49 Compare January 6, 2016 11:53

def _on_unsupported_content(self, reply):
self.logger.log('Unsupported content detected', min_level=3)
self._is_unsupported_content = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this attribute is set per browser tab and browser tab can be used to download multiple resources, if you set this attribute here will it affect other requests going through same webpage? e.g. script doing

function main (splash)
    splash:go("url_with_unsupported_content") # this will set _is_unsupported_content to True
    splash:go("url with supported content") # will this go through?
end

other thing worth noting is that there could be multiple resources downloaded when rendering so e.g.

splash:go("some page")

may issue 10 requests, first 6 will have supported content, but 7th will have unsupported content, what will happen with resources 7-10? will they be downloaded all right?

If only one among many resources is unsupported (e.g. there are many stylesheets and only one is corrupted) what response will user get?

In mockserver there is child resource called "subresources" you could probably add another similar test resource similar that would try to fetch one resource with unsupported content while rendering.

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

Successfully merging this pull request may close these issues.

2 participants