Skip to content

Commit 944ad2a

Browse files
committed
Serve ipr disclosures which are available on the server directly, instead of through an external http link in an <iframe/>. The <iframe/> method can result in mixing https and http content in the page, which some browser take issue with.
- Legacy-Id: 2024
1 parent a539f65 commit 944ad2a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

ietf/ipr/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
from django.template import RequestContext
55
from django.template.loader import render_to_string
66
from django.http import HttpResponse, Http404
7+
from django.conf import settings
78
from ietf.idtracker.models import IETFWG
89
from ietf.ipr.models import IprDetail, SELECT_CHOICES, LICENSE_CHOICES
910
from ietf.ipr.view_sections import section_table
1011
from ietf.utils import log
12+
import os
1113

1214

1315
def default(request):
@@ -93,6 +95,10 @@ def show(request, ipr_id=None, removed=None):
9395
ipr.is_pending = dict(SELECT_CHOICES)[ipr.is_pending]
9496
if ipr.applies_to_all:
9597
ipr.applies_to_all = dict(SELECT_CHOICES)[ipr.applies_to_all]
98+
if ipr.legacy_url_0 and ipr.legacy_url_0.startswith("http://www.ietf.org/") and not ipr.legacy_url_0.endswith(".pdf"):
99+
file = open(os.path.join(settings.IPR_DOCUMENT_PATH, os.path.basename(ipr.legacy_url_0)))
100+
ipr.legacy_text = file.read().decode("latin-1")
101+
file.close()
96102
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list},
97103
context_instance=RequestContext(request))
98104

ietf/templates/ipr/details.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,13 @@ <h3>{{ ipr.title|escape }}</h3>
408408
{% if ipr.legacy_url_0 %}
409409
<blockquote>
410410
<h3>The text of the original IPR declaration:</h3>
411+
{% if ipr.legacy_text %}
412+
<pre>{{ipr.legacy_text|safe}}</pre>
413+
{% else %}
411414
<iframe src="{{ipr.legacy_url_0}}" style="width:55em; height:30em">
412415
Warning: Could not embed {{ipr.legacy_url_0}}.
413416
</iframe>
417+
{% endif %}
414418
</blockquote>
415419
{% endif %}
416420

0 commit comments

Comments
 (0)