Convert subscription requests to POST

This commit is contained in:
spikecodes 2021-01-30 21:21:46 -08:00
parent 7933d840b3
commit 269bb0bfb6
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
5 changed files with 64 additions and 63 deletions

View file

@ -105,7 +105,7 @@ async fn main() -> std::io::Result<()> {
.route("/", web::get().to(subreddit::page))
.route("/{sort:hot|new|top|rising|controversial}/", web::get().to(subreddit::page))
// Handle subscribe/unsubscribe
.route("/{action:subscribe|unsubscribe}/", web::get().to(subreddit::subscriptions))
.route("/{action:subscribe|unsubscribe}/", web::post().to(subreddit::subscriptions))
// View post on subreddit
.service(
web::scope("/comments/{id}/{title}")