{"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726413829", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726413829, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxMzgyOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-12T23:52:50Z", "updated_at": "2020-11-12T23:54:16Z", "author_association": "OWNER", "body": "Hmm... it's not just the `.csv` and `.json` export links - it's the column headings (which can be clicked to change the sort order) as well. Here's an extract of the HTML from that page:\r\n```html\r\n
This data as \r\n json, \r\n CSV (\r\n advanced)\r\n
\r\n\r\n Link\r\n | \r\n\r\n rowid \u25bc\r\n | \r\n\r\n PARSE_EXCEPTION_ID\r\n | \r\n\r\n PARSE_EXCEPTION_DESCRIPTION\r\n | \r\n
---|---|---|---|
\r\n 1\r\n | \r\n1 | \r\n0 | \r\nRUNTIME | \r\n
\r\n 2\r\n | \r\n2 | \r\n1 | \r\nENCRYPTION | \r\n
\r\n 3\r\n | \r\n3 | \r\n2 | \r\nACCESS_PERMISSION | \r\n
\r\n 4\r\n | \r\n4 | \r\n3 | \r\nUNSUPPORTED_VERSION | \r\n
JSON shape:\r\n default,\r\n array,\r\n newline-delimited\r\n
\r\n \r\n\r\n home /\r\n corpora-metadata\r\n
\r\n```\r\nI've also been unable to replicate this in my own local environment, running `datasette fixtures.db --config base_url:/datasette/`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726415019", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726415019, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxNTAxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-12T23:56:23Z", "updated_at": "2020-11-12T23:56:23Z", "author_association": "OWNER", "body": "@tballison is there any chance you're running any custom templates in that installation? I'm really confused as to why I can't replicate the bug.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726415991", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726415991, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxNTk5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-12T23:59:34Z", "updated_at": "2020-11-12T23:59:34Z", "author_association": "OWNER", "body": "The sort headers are generated by this template code: https://github.com/simonw/datasette/blob/5eb8e9bf250b26e30b017d39a392c33973997656/datasette/templates/_table.html#L11-L15\r\n\r\nThe export links use this code:\r\n\r\nhttps://github.com/simonw/datasette/blob/5eb8e9bf250b26e30b017d39a392c33973997656/datasette/templates/table.html#L134\r\n\r\nhttps://github.com/simonw/datasette/blob/5eb8e9bf250b26e30b017d39a392c33973997656/datasette/templates/table.html#L180-L201", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726416330", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726416330, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxNjMzMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-13T00:00:43Z", "updated_at": "2020-11-13T00:00:43Z", "author_association": "OWNER", "body": "Here's where `url_csv` comes from: https://github.com/simonw/datasette/blob/11eb1e026f3d84cb771f8d6e204939cbaee130cd/datasette/views/base.py#L542-L545", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726798745", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726798745, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjc5ODc0NQ==", "user": {"value": 6739646, "label": "tballison"}, "created_at": "2020-11-13T14:35:22Z", "updated_at": "2020-11-13T14:35:22Z", "author_association": "NONE", "body": "I'm starting this with docker like so:\r\n\r\n`docker run --name datasette -d -p 8001:8001 -v `pwd`:/mnt datasetteproject/datasette datasette -p 8001 -h 0.0.0.0 /mnt/file_profiles.db --config sql_time_limit_ms:120000 --config max_returned_rows:100000 --config base_url:/datasette/ --config cache_size_kb:50000`\r\n\r\nI'm not doing any templating or anything else custom.\r\n\r\nApropos of nothing, I swapped out a simpler db, so this query should now work:\r\n\r\nhttps://corpora.tika.apache.org/datasette/file_profiles?sql=select%0D%0A++*%0D%0Afrom%0D%0A++file_profiles+fp%0D%0Alimit%0D%0A++10", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726801731", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726801731, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjgwMTczMQ==", "user": {"value": 6739646, "label": "tballison"}, "created_at": "2020-11-13T14:40:56Z", "updated_at": "2020-11-13T14:40:56Z", "author_association": "NONE", "body": "My headers aren't clickable/sortable with custom sql, but I think that's by design.\r\n\r\nIn the default view, https://corpora.tika.apache.org/datasette/file_profiles/file_profiles, ah, y, now I see that the headers should be sortable, but you're right the base_url is not applied.\r\n\r\nbase_url works with \"View and Edit SQL\" and with \"(advanced)\"\r\n\r\nAs you point out, does not work with the export csv, json, other or with the \"Next page\" navigational button at the bottom.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-727233553", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 727233553, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNzIzMzU1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-14T16:46:52Z", "updated_at": "2020-11-14T16:46:52Z", "author_association": "OWNER", "body": "@tballison could I see the section of your Apache config that configures the proxying to `/datasette/`?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-728262974", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 728262974, "node_id": "MDEyOklzc3VlQ29tbWVudDcyODI2Mjk3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-16T19:05:08Z", "updated_at": "2020-11-16T19:05:08Z", "author_association": "OWNER", "body": "I have a hunch that there may be some extra configuration in play here - could Apache itself be rewriting some of the links using [mod_proxy_html](https://httpd.apache.org/docs/2.4/mod/mod_proxy_html.html)?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-729018386", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 729018386, "node_id": "MDEyOklzc3VlQ29tbWVudDcyOTAxODM4Ng==", "user": {"value": 6739646, "label": "tballison"}, "created_at": "2020-11-17T15:48:58Z", "updated_at": "2020-11-17T15:48:58Z", "author_association": "NONE", "body": "I don't think we are, but I'll check with Maruan.\r\n\r\nI think this is the relevant part of our config?\r\n\r\n```\r\n Alias \"/base/\" \"/usr/share/corpora/\"\r\n