[PATCH 1 of 2] follow: Fix args for $.post() call in toggleFollowingRepo()

Ross Thomas ross at lns-nevasoft.com
Sat Feb 8 20:21:58 UTC 2020


On 2/8/20 6:05 AM, Mads Kiilerich wrote:
> Thanks. I do agree this is better. But is it fixing an actual problem? 
> The old manual encoding seems to work fine too?

Yep, it worked but it was mostly fortunate 'luck'.  It ended up using
matrix mode instead of true query params.

The resulting query string was _literally_:
   ?follows_repository_id=xxx&_session_csrf_secret_token=yyy

which was then processed as:
   param:  follows_repository_id = xxx
   param:  amp =
   matrix: _session_csrf_secret_token = yyy

If you look at the network call in the browser's dev tools you'll see
that the request payload consists of two items:
   param: follows_repository_id = xxx
   param: amp;_session_csrf_secret_token = yyy

So, yes, it will continue to work.  This just seemed cleaner.

Ross.


More information about the kallithea-general mailing list