View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0004833 | Taler | taler-merchant-demos | public | 2016-12-07 10:29 | 2024-01-12 13:08 |
| Reporter | Marcello Stanisci | Assigned To | Marcello Stanisci | Resolution deadline | |
| Implementer | Reviewer | ||||
| Release signed by | Deployed by | ||||
| Verifier | Communicator | ||||
| Data protection authority notification required | No | ||||
| CSIRT notification required | No | ||||
| Estimated effort (hours) | Actual effort (hours) | 0 | |||
| Fast-track | No | ||||
| Work package | none | ||||
| 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 10:29 | Marcello Stanisci | New Issue | |
| 2016-12-07 10:30 | Marcello Stanisci | Priority | normal => high |
| 2016-12-07 10:31 | Marcello Stanisci | Note Added: 0011572 | |
| 2016-12-07 11:32 | Florian Dold | Note Added: 0011573 | |
| 2016-12-07 13:08 | Marcello Stanisci | Note Added: 0011574 | |
| 2016-12-07 13:26 | Florian Dold | Note Added: 0011576 | |
| 2016-12-07 16:34 | Marcello Stanisci | Note Added: 0011577 | |
| 2016-12-07 16:38 | Florian Dold | Note Added: 0011578 | |
| 2016-12-07 17:01 | Marcello Stanisci | Assigned To | => Marcello Stanisci |
| 2016-12-07 17:01 | Marcello Stanisci | Status | new => assigned |
| 2016-12-07 19:52 | Marcello Stanisci | Note Added: 0011579 | |
| 2016-12-07 19:52 | Marcello Stanisci | Status | assigned => informing |
| 2016-12-07 19:52 | Marcello Stanisci | Resolution | open => fixed |
| 2017-01-16 09:22 | Christian Grothoff | Product Version | => git (master) |
| 2017-01-16 09:22 | Christian Grothoff | Fixed in Version | => 0.3 |
| 2017-01-16 09:22 | Christian Grothoff | Target Version | => 0.3 |
| 2017-06-06 12:18 | Christian Grothoff | Status | informing => closed |
| 2024-01-12 13:08 | Christian Grothoff | Category | merchant frontend (blog) => Merchant frontends (Python3) |
| 2026-08-23 14:16 | Florian Dold | Category | Merchant frontends (Python3) => taler-merchant-demos |