instantpage / instant.page

Make your site’s pages instant in 1 minute and improve your conversion rate by 1%
https://instant.page
MIT License
6.04k stars 205 forks source link

Disable links if data-method exists and is not GET #47

Closed david-a-wheeler closed 4 years ago

david-a-wheeler commented 5 years ago

Rails is a popular framework and supports an optional "data-method" parameter, like this:

<a rel="nofollow" data-method="delete" href="/en/logout">

It would be very bad to automatically follow such links if data-method exists and is not GET.

Solution: Simply don't preload a links that have a data-method and provide a value other than GET (any case).

See also: https://github.com/dieulot/instantclick/issues/170

dieulot commented 4 years ago

I don’t want to add code specific to Rails.

Also, if the /en/logout endpoint works only on DELETE, preloading it on GET should have no adverse effect, right?