home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

13 rows where issue = 1435917503 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • simonw 12
  • mattmalcher 1

author_association 2

  • OWNER 12
  • NONE 1

issue 1

  • Errors when using table filters behind a proxy · 13 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1311437901 https://github.com/simonw/datasette/issues/1883#issuecomment-1311437901 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKvRN mattmalcher 31312775 2022-11-11T09:20:21Z 2022-11-11T09:20:21Z NONE

Amazing - thank you for fixing and releasing that so quickly and for showing your process! <3

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311314981 https://github.com/simonw/datasette/issues/1883#issuecomment-1311314981 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKRQl simonw 9599 2022-11-11T07:15:48Z 2022-11-11T07:15:48Z OWNER

I released that fix in Datasette 0.63.1: https://docs.datasette.io/en/stable/changelog.html#v0-63-1

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311299535 https://github.com/simonw/datasette/issues/1883#issuecomment-1311299535 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKNfP simonw 9599 2022-11-11T06:54:58Z 2022-11-11T06:54:58Z OWNER

This time deployed with: cd demos/apache-proxy fly deploy --build-arg DATASETTE_REF=8d9a957c6329d26cc1e417b5d6911640d74765eb To ensure the exact commit with the fix.

And that fixed it! % curl -i 'https://datasette-apache-proxy-demo.datasette.io/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid' HTTP/2 302 date: Fri, 11 Nov 2022 06:54:45 GMT server: Fly/b1863e2e7 (2022-11-09) location: /prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1 link: </prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1>; rel=preload content-type: text/plain x-proxied-by: Apache2 Debian via: 2 fly.io fly-request-id: 01GHJQGBSXBR7E53TY0EKMQ9PA-sjc

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311292463 https://github.com/simonw/datasette/issues/1883#issuecomment-1311292463 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKLwv simonw 9599 2022-11-11T06:44:24Z 2022-11-11T06:44:24Z OWNER

Modifying that test to the following does indeed cause a failure: python def test_base_url_affects_filter_redirects(app_client_base_url_prefix): response = app_client_base_url_prefix.get( "/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid" ) assert response.status == 302 assert ( response.headers["location"] == "/prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1" )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311291632 https://github.com/simonw/datasette/issues/1883#issuecomment-1311291632 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKLjw simonw 9599 2022-11-11T06:43:00Z 2022-11-11T06:43:00Z OWNER

https://datasette-apache-proxy-demo.datasette.io/prefix/-/asgi-scope is useful:

It confirms that /prefix/ is nowhere to be seen in the incoming request data:

'path': '/-/asgi-scope', 'query_string': b'', 'raw_path': b'/-/asgi-scope',

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311290115 https://github.com/simonw/datasette/issues/1883#issuecomment-1311290115 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKLMD simonw 9599 2022-11-11T06:40:14Z 2022-11-11T06:41:56Z OWNER

I modified that config file to have this line instead: ProxyPass /prefix/ http://127.0.0.1:8001/ nocanon And then deployed it by running:

flyctl deploy --build-arg DATASETTE_REF=main

This does NOT seem to have fixed the bug:

~ % curl -i 'https://datasette-apache-proxy-demo.datasette.io/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid' HTTP/2 302 date: Fri, 11 Nov 2022 06:40:01 GMT server: Fly/b1863e2e7 (2022-11-09) location: /fixtures/binary_data?_sort=rowid&rowid__exact=1 link: </fixtures/binary_data?_sort=rowid&rowid__exact=1>; rel=preload content-type: text/plain x-proxied-by: Apache2 Debian via: 2 fly.io fly-request-id: 01GHJPNCF51CJ626EWZEHK2CH9-sjc

https://datasette-apache-proxy-demo.datasette.io/prefix/-/versions seems to confirm that this is the latest deployed version (0.63), so it looks like the deploy worked.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311286593 https://github.com/simonw/datasette/issues/1883#issuecomment-1311286593 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKKVB simonw 9599 2022-11-11T06:34:09Z 2022-11-11T06:34:09Z OWNER

https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass includes this note:

Normally, mod_proxy will canonicalise ProxyPassed URLs. But this may be incompatible with some backends, particularly those that make use of PATH_INFO. The optional nocanon keyword suppresses this and passes the URL path "raw" to the backend.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311284537 https://github.com/simonw/datasette/issues/1883#issuecomment-1311284537 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKJ05 simonw 9599 2022-11-11T06:30:38Z 2022-11-11T06:30:38Z OWNER

Is there a chance that it's Apache that's messing with that location: header here, not Datasette?

https://github.com/simonw/datasette/blob/bbaab3b38ec2ce5944239ffbe2dd53328df40fff/demos/apache-proxy/000-default.conf#L7-L13

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311283301 https://github.com/simonw/datasette/issues/1883#issuecomment-1311283301 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKJhl simonw 9599 2022-11-11T06:28:38Z 2022-11-11T06:29:33Z OWNER

path_with_added_args(request, redirect_params) should be preserving the current path from the request.

https://github.com/simonw/datasette/blob/bbaab3b38ec2ce5944239ffbe2dd53328df40fff/datasette/utils/init.py#L273-L286

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311282970 https://github.com/simonw/datasette/issues/1883#issuecomment-1311282970 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKJca simonw 9599 2022-11-11T06:28:05Z 2022-11-11T06:28:05Z OWNER

Relevant code: https://github.com/simonw/datasette/blob/bbaab3b38ec2ce5944239ffbe2dd53328df40fff/datasette/views/table.py#L227-L249

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311280709 https://github.com/simonw/datasette/issues/1883#issuecomment-1311280709 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKI5F simonw 9599 2022-11-11T06:25:27Z 2022-11-11T06:25:27Z OWNER

I tried adding this test but it passed! I expected it to fail:

python def test_base_url_affects_filter_redirects(app_client_base_url_prefix): response = app_client_base_url_prefix.get( "/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid" ) assert response.status == 302 assert ( response.headers["location"] == "/prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1" )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311278678 https://github.com/simonw/datasette/issues/1883#issuecomment-1311278678 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKIZW simonw 9599 2022-11-11T06:22:37Z 2022-11-11T06:22:37Z OWNER

If you view source on that page the HTML looks correct: ```html

<form class="filters" action="/prefix/fixtures/binary_data" method="get"> ``` (I just added a test that confirms this too.) But... it looks like the bug is in the redirection code. https://datasette-apache-proxy-demo.datasette.io/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid returns the following: location: /fixtures/binary_data?_sort=rowid&rowid__exact=1 Which is incorrect.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  
1311273461 https://github.com/simonw/datasette/issues/1883#issuecomment-1311273461 https://api.github.com/repos/simonw/datasette/issues/1883 IC_kwDOBm6k_c5OKHH1 simonw 9599 2022-11-11T06:16:08Z 2022-11-11T06:16:08Z OWNER

Great catch, thanks!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Errors when using table filters behind a proxy 1435917503  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 21.259ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows