Changeset - dac0bff4d2a3
default
0
1
0
follow: Fix args for $.post() call in toggleFollowingRepo()
Before, the resulting query string was _literally_ like:
?follows_repository_id=xxx&_session_csrf_secret_token=yyy
The server side stack ended up parsing it as:
>>> urllib.parse.parse_qsl("follows_repository_id=xxx&_session_csrf_secret_token=yyy", keep_blank_values=True)
[('follows_repository_id', 'xxx'), ('amp', ''), ('_session_csrf_secret_token', 'yyy')]
because the HTML encoding of & isn't relevant here and it thus looks like a
"matrix URL" (as drafted on https://www.w3.org/DesignIssues/MatrixURIs.html )
with the following values:
param: follows_repository_id = xxx
param: amp =
matrix: _session_csrf_secret_token = yyy
It thus ended up with the right values (if ignoring 'amp') and it thus worked
anyway.
Instead, clean it up and just pass a dict to jQuery.post as intended.
Before, the resulting query string was _literally_ like:
?follows_repository_id=xxx&_session_csrf_secret_token=yyy
The server side stack ended up parsing it as:
>>> urllib.parse.parse_qsl("follows_repository_id=xxx&_session_csrf_secret_token=yyy", keep_blank_values=True)
[('follows_repository_id', 'xxx'), ('amp', ''), ('_session_csrf_secret_token', 'yyy')]
because the HTML encoding of & isn't relevant here and it thus looks like a
"matrix URL" (as drafted on https://www.w3.org/DesignIssues/MatrixURIs.html )
with the following values:
param: follows_repository_id = xxx
param: amp =
matrix: _session_csrf_secret_token = yyy
It thus ended up with the right values (if ignoring 'amp') and it thus worked
anyway.
Instead, clean it up and just pass a dict to jQuery.post as intended.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)