View Issue Details

IDProjectCategoryView StatusLast Update
0004833Talertaler-merchant-demospublic2024-01-12 13:08
ReporterMarcello Stanisci Assigned ToMarcello Stanisci Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityhighSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.3Fixed in Version0.3 
Summary0004833: url() breaks JS version
DescriptionThe JS version of the blog uses this jinja filter 'url("static/.../")'.

When trying to buy articles, this resolves to "/essay/static/...", that
does not exist, so it breaks the payment because taler-wallet-lib cannot
be found.

Fortunately, the JS-free version seems to not suffer from this.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Marcello Stanisci

2016-12-07 10:31

reporter   ~0011572

Shall we get rid of url() and resume the hardcoded way?

Florian Dold

2016-12-07 11:32

manager   ~0011573

I don't see why we can't fix this if the JavaScript-free version works correctly. In this case, it looks like we should just use an application-root relative URL in the src tag for the taler-wallet-lib script.


We can't simply hardcode everything, because we cannot make the assumption that the front end is mounted under "/".

Marcello Stanisci

2016-12-07 13:08

reporter   ~0011574

Yes, we can, I never said we can't :)

Anyway it seems hard to find documentation about this 'url()' helper function
you use in templates: who provides it, Jinja? Flask?

Florian Dold

2016-12-07 13:26

manager   ~0011576

It's defined here: https://git.taler.net/merchant-frontends.git/tree/talerfrontends/blog/blog.py#n55

We provide it for Jinja through Flask's API. If you need to change it, feel free to do so or ask me to add something.

Marcello Stanisci

2016-12-07 16:34

reporter   ~0011577

The way url() works looks fine. The problem is that the browser then appends
that relative URL to one having this "../essay/.." in the middle, and that corrupts things.
That seems unfixable if url() doesn't return an absolute URL ...

Florian Dold

2016-12-07 16:38

manager   ~0011578

We can make it return a URL absolute to the host, by starting it with a slash.

When your browser is at https://example.com/foo/bar, and you click a link to to "spam", you'll end up with https://example.com/foo/bar/spam. But if you navigate to "/spam", then you'll end up at https://example.com/spam.

We just have to make the url helper return a host-relative (not path-relative) URL that respects the application's root.

Marcello Stanisci

2016-12-07 19:52

reporter   ~0011579

Just prepending a slash fixed it. 1a84981

Issue History

Date ModifiedUsernameFieldChange
2016-12-07 10:29Marcello StanisciNew Issue
2016-12-07 10:30Marcello StanisciPrioritynormal => high
2016-12-07 10:31Marcello StanisciNote Added: 0011572
2016-12-07 11:32Florian DoldNote Added: 0011573
2016-12-07 13:08Marcello StanisciNote Added: 0011574
2016-12-07 13:26Florian DoldNote Added: 0011576
2016-12-07 16:34Marcello StanisciNote Added: 0011577
2016-12-07 16:38Florian DoldNote Added: 0011578
2016-12-07 17:01Marcello StanisciAssigned To => Marcello Stanisci
2016-12-07 17:01Marcello StanisciStatusnew => assigned
2016-12-07 19:52Marcello StanisciNote Added: 0011579
2016-12-07 19:52Marcello StanisciStatusassigned => informing
2016-12-07 19:52Marcello StanisciResolutionopen => fixed
2017-01-16 09:22Christian GrothoffProduct Version => git (master)
2017-01-16 09:22Christian GrothoffFixed in Version => 0.3
2017-01-16 09:22Christian GrothoffTarget Version => 0.3
2017-06-06 12:18Christian GrothoffStatusinforming => closed
2024-01-12 13:08Christian GrothoffCategorymerchant frontend (blog) => Merchant frontends (Python3)
2026-08-23 14:16Florian DoldCategoryMerchant frontends (Python3) => taler-merchant-demos