We have a cookiejar abstraction, I think setting it to an always-empty jar like you describe is best. :)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717746043, "label": "datasette.client internal requests mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1001#issuecomment-705905121", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1001", "id": 705905121, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTkwNTEyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T01:00:07Z", "updated_at": "2020-10-09T01:00:07Z", "author_association": "OWNER", "body": "The www.djangoproject.com site returns an empty page:\r\n```\r\n~ % curl -vv -XOPTIONS https://www.djangoproject.com/\r\n* Trying 151.101.42.217:443...\r\n* Connected to www.djangoproject.com (151.101.42.217) port 443 (#0)\r\n* ALPN, offering http/1.1\r\n* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\r\n* Server certificate: osff2.map.fastly.net\r\n* Server certificate: GlobalSign CloudSSL CA - SHA256 - G3\r\n* Server certificate: GlobalSign Root CA\r\n> OPTIONS / HTTP/1.1\r\n> Host: www.djangoproject.com\r\n> User-Agent: curl/7.70.0\r\n> Accept: */*\r\n> \r\n* Mark bundle as not supporting multiuse\r\n< HTTP/1.1 200 OK\r\n< Connection: keep-alive\r\n< Content-Length: 0\r\n< Server: nginx\r\n< Content-Type: text/html; charset=utf-8\r\n< Allow: GET, HEAD, OPTIONS\r\n< Content-Language: en\r\n< X-Frame-Options: SAMEORIGIN\r\n< X-Content-Type-Options: nosniff\r\n< X-XSS-Protection: 1; mode=block\r\n< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload\r\n< Access-Control-Allow-Origin: https://code.djangoproject.com\r\n< Accept-Ranges: bytes\r\n< Date: Fri, 09 Oct 2020 00:59:42 GMT\r\n< Via: 1.1 varnish\r\n< X-Served-By: cache-sjc10047-SJC\r\n< X-Cache: MISS\r\n< X-Cache-Hits: 0\r\n< X-Timer: S1602205182.833493,VS0,VE305\r\n< Vary: Accept-Language, Accept-Encoding\r\n< \r\n* Connection #0 to host www.djangoproject.com left intact\r\n~ % \r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717768441, "label": "OPTIONS requests return a 500 error"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1000#issuecomment-705937696", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1000", "id": 705937696, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTkzNzY5Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T02:52:53Z", "updated_at": "2020-10-09T02:52:53Z", "author_association": "OWNER", "body": "These failures are giving me a severe \"how did this ever work in the first place?\" vibe:\r\n```\r\nFAILED tests/test_html.py::test_base_url_config[/fixtures/compound_three_primary_keys-https://example.com/]\r\nFAILED tests/test_html.py::test_base_url_config[/fixtures/compound_three_primary_keys/a,a,a-https://example.com/]\r\nFAILED tests/test_html.py::test_base_url_config[/fixtures/paginated_view-https://example.com/]\r\nFAILED tests/test_html.py::test_base_url_config[/fixtures/facetable-https://example.com/]\r\n```\r\nI have a fix for them, no idea why they weren't already failing though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717746043, "label": "datasette.client internal requests mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1006#issuecomment-706270877", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1006", "id": 706270877, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjI3MDg3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T16:12:09Z", "updated_at": "2020-10-09T16:12:09Z", "author_association": "OWNER", "body": "This can become a section on https://docs.datasette.io/en/stable/internals.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718264811, "label": "Documentation for datasette.client"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1000#issuecomment-705940507", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1000", "id": 705940507, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTk0MDUwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T03:04:15Z", "updated_at": "2020-10-09T03:04:15Z", "author_association": "OWNER", "body": "This is really weird: new set of test failures that I wasn't seeing before, and those tests aren't failing on my laptop:\r\n```\r\n=========================== short test summary info ============================\r\nFAILED tests/test_api.py::test_table_with_slashes_in_name - assert 404 == 200\r\nFAILED tests/test_api.py::test_row_strange_table_name - assert 404 == 200\r\nFAILED tests/test_html.py::test_row_strange_table_name_with_url_hash - assert...\r\nFAILED tests/test_html.py::test_css_classes_on_body[/fixtures/table%2Fwith%2Fslashes.csv-expected_classes5]\r\nFAILED tests/test_html.py::test_templates_considered[/fixtures/table%2Fwith%2Fslashes.csv-table-fixtures-tablewithslashescsv-fa7563.html, *table.html]\r\n================== 5 failed, 738 passed in 194.73s (0:03:14) ===================\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717746043, "label": "datasette.client internal requests mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1001#issuecomment-705904566", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1001", "id": 705904566, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTkwNDU2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T00:58:08Z", "updated_at": "2020-10-09T00:58:08Z", "author_association": "OWNER", "body": "To get a traceback:\r\n```\r\ndatasette . -p 8009 --pdb\r\n```\r\nAnd then:\r\n```\r\ncurl -XOPTIONS http://127.0.0.1:8009\r\n```\r\nThis causes the server to open a debugging prompt:\r\n```\r\nINFO: 127.0.0.1:59514 - \"OPTIONS / HTTP/1.1\" 500 Internal Server Error\r\n> /Users/simon/Dropbox/Development/datasette/datasette/views/base.py(115)dispatch_request()\r\n-> return await handler(request, *args, **kwargs)\r\n(Pdb) list\r\n110 \t def database_color(self, database):\r\n111 \t return \"ff0000\"\r\n112 \t\r\n113 \t async def dispatch_request(self, request, *args, **kwargs):\r\n114 \t handler = getattr(self, request.method.lower(), None)\r\n115 ->\t return await handler(request, *args, **kwargs)\r\n116 \t\r\n117 \t async def render(self, templates, request, context=None):\r\n118 \t context = context or {}\r\n119 \t template = self.ds.jinja_env.select_template(templates)\r\n120 \t template_context = {\r\n(Pdb) \r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717768441, "label": "OPTIONS requests return a 500 error"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1001#issuecomment-705904759", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1001", "id": 705904759, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTkwNDc1OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T00:58:47Z", "updated_at": "2020-10-09T00:58:47Z", "author_association": "OWNER", "body": "What should an OPTIONS request return, anyway?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717768441, "label": "OPTIONS requests return a 500 error"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1000#issuecomment-705921006", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1000", "id": 705921006, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTkyMTAwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T01:55:01Z", "updated_at": "2020-10-09T01:55:01Z", "author_association": "OWNER", "body": "With the single client that is reused for all tests:\r\n```\r\n% time pytest tests/test_api.py\r\n...\r\n6.73s user 9.91s system 81% cpu 20.365 total\r\n```\r\nAfter switching back to this class:\r\n```python\r\nclass DatasetteClient:\r\n def __init__(self, ds):\r\n self.app = ds.app()\r\n\r\n def _fix(self, path):\r\n if path.startswith(\"/\"):\r\n path = \"http://localhost{}\".format(path)\r\n return path\r\n\r\n async def get(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.get(self._fix(path), **kwargs)\r\n\r\n async def options(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.options(self._fix(path), **kwargs)\r\n\r\n async def head(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.head(self._fix(path), **kwargs)\r\n\r\n async def post(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.post(self._fix(path), **kwargs)\r\n\r\n async def put(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.put(self._fix(path), **kwargs)\r\n\r\n async def patch(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.patch(self._fix(path), **kwargs)\r\n\r\n async def delete(self, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.delete(self._fix(path), **kwargs)\r\n\r\n async def request(self, method, path, **kwargs):\r\n async with httpx.AsyncClient(app=self.app) as client:\r\n return await client.request(method, self._fix(path), **kwargs)\r\n```\r\nThe time taken is:\r\n```\r\n% time pytest tests/test_api.py\r\n...\r\n7.26s user 10.02s system 82% cpu 21.014 total\r\n```\r\nThat's close enough that I don't feel I need to investigate this further.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 717746043, "label": "datasette.client internal requests mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1003#issuecomment-706272322", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1003", "id": 706272322, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjI3MjMyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T16:14:56Z", "updated_at": "2020-10-09T16:14:56Z", "author_association": "OWNER", "body": "Yes I think that makes sense. I added `json` to the template context in Dogsheep Beta just a few days ago because I needed that: https://github.com/dogsheep/dogsheep-beta/blob/bed9df2b3ef68189e2e445427721a28f4e9b4887/dogsheep_beta/__init__.py#L176", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718238967, "label": "from_json jinja2 filter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1001#issuecomment-705904917", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1001", "id": 705904917, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNTkwNDkxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-09T00:59:25Z", "updated_at": "2020-10-09T00:59:25Z", "author_association": "OWNER", "body": "```\r\n~ % curl -XOPTIONS https://www.google.com/\r\n\r\n\r\n \r\n \r\n