Open jcbrand opened 12 years ago
Just tested it now with Deliverance 0.6.1, but the problem persists.
Looks like this is happening in lxml.html.make_links_absolute
-- unless explicitly disabled, that function's default behavior is to use the <base>
tag to make the links absolute, and then discard the <base>
tag from the resulting document. We could just copy over the logic in lxml.html.resolve_base_href
but without the b.drop_tree()
.
I understand the logic of the current behavior though -- if all the links relative to the base href are made absolute and then rewritten, the base tag presumably doesn't serve any purpose anymore. Could you spell out a case where you'd still want the base tag present after rewriting links?
And, in that case, should the base href itself be rewritten too? (Or, alternatively, should we only rewrite the base href, and leave all other links relative to it?)
When using Deliverance 0.6 (with Plone):
If we have a proxy rule like this:
And then we replace the theme head with the content head:
<replace content="/html/head" theme="/html/head" />
With "rewrite-links" enabled, the
<base>
tag is stripped from the content head and not inserted into the theme, with "rewire-links" off, the<base>
tag does appear.