diff --git a/common/djangoapps/contentserver/middleware.py b/common/djangoapps/contentserver/middleware.py
index f0734dd202..d30a3f7900 100644
--- a/common/djangoapps/contentserver/middleware.py
+++ b/common/djangoapps/contentserver/middleware.py
@@ -33,10 +33,8 @@ class StaticContentServer(object):
# see if the last-modified at hasn't changed, if not return a 302 (Not Modified)
- logging.debug(request.META)
-
# convert over the DB persistent last modified timestamp to a HTTP compatible
- # timestamp
+ # timestamp, so we can simply compare the strings
last_modified_at_str = content.last_modified_at.strftime("%a, %d-%b-%Y %H:%M:%S GMT")
# see if the client has cached this content, if so then compare the
diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py
index f5672ca1b8..471a1ea7fd 100644
--- a/common/lib/xmodule/xmodule/html_module.py
+++ b/common/lib/xmodule/xmodule/html_module.py
@@ -4,6 +4,7 @@ import logging
import os
import sys
from lxml import etree
+from lxml.html import rewrite_links
from path import path
from .x_module import XModule
@@ -18,7 +19,9 @@ log = logging.getLogger("mitx.courseware")
class HtmlModule(XModule):
def get_html(self):
- return self.html
+ # cdodge: perform link substitutions for any references to course static content (e.g. images)
+ return rewrite_links(self.html, self.rewrite_content_links, self)
+ #return self.html
def __init__(self, system, location, definition, descriptor,
instance_state=None, shared_state=None, **kwargs):
@@ -26,6 +29,11 @@ class HtmlModule(XModule):
instance_state, shared_state, **kwargs)
self.html = self.definition['data']
+ def rewrite_content_links(link, self):
+ if link.startswith('xasset:'):
+ logging.debug('found link: {0}'.format(link))
+ return link
+
class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
"""