View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004833 | Taler | Merchant frontends (Python3) | public | 2016-12-07 11:29 | 2024-01-12 14:08 |
Reporter | Marcello Stanisci | Assigned To | Marcello Stanisci | ||
Priority | high | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | git (master) | ||||
Target Version | 0.3 | Fixed in Version | 0.3 | ||
Summary | 0004833: url() breaks JS version | ||||
Description | The 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. | ||||
Tags | No tags attached. | ||||
|
Shall we get rid of url() and resume the hardcoded way? |
|
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 "/". |
|
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? |
|
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. |
|
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 ... |
|
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. |
|
Just prepending a slash fixed it. 1a84981 |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-12-07 11:29 | Marcello Stanisci | New Issue | |
2016-12-07 11:30 | Marcello Stanisci | Priority | normal => high |
2016-12-07 11:31 | Marcello Stanisci | Note Added: 0011572 | |
2016-12-07 12:32 | Florian Dold | Note Added: 0011573 | |
2016-12-07 14:08 | Marcello Stanisci | Note Added: 0011574 | |
2016-12-07 14:26 | Florian Dold | Note Added: 0011576 | |
2016-12-07 17:34 | Marcello Stanisci | Note Added: 0011577 | |
2016-12-07 17:38 | Florian Dold | Note Added: 0011578 | |
2016-12-07 18:01 | Marcello Stanisci | Assigned To | => Marcello Stanisci |
2016-12-07 18:01 | Marcello Stanisci | Status | new => assigned |
2016-12-07 20:52 | Marcello Stanisci | Note Added: 0011579 | |
2016-12-07 20:52 | Marcello Stanisci | Status | assigned => resolved |
2016-12-07 20:52 | Marcello Stanisci | Resolution | open => fixed |
2017-01-16 10:22 | Christian Grothoff | Product Version | => git (master) |
2017-01-16 10:22 | Christian Grothoff | Fixed in Version | => 0.3 |
2017-01-16 10:22 | Christian Grothoff | Target Version | => 0.3 |
2017-06-06 14:18 | Christian Grothoff | Status | resolved => closed |
2024-01-12 14:08 | Christian Grothoff | Category | merchant frontend (blog) => Merchant frontends (Python3) |