Live data from Hacker News

You know how HTTP GET requests are meant to be idempotent?

twitter.com

311–313 of 313 posts

Re: You know how HTTP GET requests are meant to be idempotent?

#311

Earlier quoted context omitted.

It still seems a bit odd to do it this way when it's so easy to do it right. I hope the hostnames / IP addresses aren't predictable, because all it would take to cause trouble is to send an HTML email containing something like " rel="nofollow">http://192.168.0.1/reboot"> to your staff and then you'd trigger a bunch of reboots whenever anybody opened their email. Or just send a link to a page that does the same thing.…

I feel like the 'do it right' comment is a bit speculative or entitled. It does create a usability barrier that I was trying to avoid. Even the extra button click is a pain in the ass when you're rebooting dozens of machines (sometimes daily). Your second paragraph is spot on. Very good point and kind of why I posted here in the first place. Two minds are always better than one. I forgot about the image attack. I've…

Just a quick follow up, I've made the change from GET to POST.

Re: You know how HTTP GET requests are meant to be idempotent?

#312

Earlier quoted context omitted.

Just because a server announces HTTP/1.1 doesn't mean it conforms to that specific RFC.

That non-RFC-compliant implementations of HTTP exist irrelevant to what properties HTTP methods are supposed to have, which is the issue under discussion.

It is compliant to an RFC, just not a specific RFC. That's part of the issue, that's simply taken for granted because of ideology.

Re: You know how HTTP GET requests are meant to be idempotent?

#313
post #58

Well, a while ago I saw this code (on my own project!): window.open("?controller=users&action=changePassword&name=" + user_name + "&password=" + password) I was horrified, glad it isn't live yet, and I fixed it immediately. But I'm still wondering whether I was so sleep-deprived or drunk when I wrote this. It's over SSL, so it should not be that big deal, but still, GET shouldn't be used for such things.

Well you don’t seem to validate the existing password prior to authorizing the change. Good CSRF protection on GET requests is also near impossible to implement as GET is intended to be a “safe” request as in a request that does not modify a state but this isn’t something that is actually practiced.

Actually, I do. This is not a form for user to change his own password, rather a administrators form to change another user's form. And for such actions the administrators identity and privileges are checked. But I understand your reasoning and thank you for pointing it out.

And yeah, I try to use GET only for safe requests, but I should be more careful.

Post reply on HN