Skip to content

Commit d94cf8b

Browse files
authored
Merge pull request #7 from MartinMikita/patch-1
Don't escape URLs passed to Javascript from template
2 parents 87b7e08 + 391406e commit d94cf8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: flask_fastspring.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ def milliseconds_to_datetime(m):
264264
function fastspringOnPopupWebhookReceived(data) {
265265
if (!data) return;
266266
var xhr = new XMLHttpRequest();
267-
xhr.open("POST", "{{ webhook }}", true);
267+
xhr.open("POST", "{{ webhook | safe }}", true);
268268
xhr.setRequestHeader("Content-Type", "application/json");
269269
xhr.onreadystatechange = function() {
270270
if (xhr.readyState === XMLHttpRequest.DONE) {
271271
if (xhr.status === 200) {
272-
fastspringRedirectUrl = '{{ request.url }}';
272+
fastspringRedirectUrl = '{{ request.url | safe }}';
273273
} else if (xhr.status === 201 || (301 <= xhr.status && xhr.status <= 303)) {
274274
fastspringRedirectUrl = xhr.getResponseHeader("Location");
275275
} else {

0 commit comments

Comments
 (0)