small medium large xlarge

17 Dec 2017, 14:39
Dmitriy Tarasov (1 post)

PDF p1.0 page 143 has a tip from David on product_path vs product_url. “When you use product_url, you’ll get the full enchilada with protocol and domain name. That’s the thing to use when you’re doing redirect_to, because the HTTP spec requires a fully qualified URL when doing 302 Redirect and friends.” and “You can do a redirect_to with a product_path and it’ll probably work, but it won’t be valid according to spec.”

I suppose this was based on RFC 2616 from 1999.

However since July 2014 we have RFC 7231 that explicitly allow a relative URI.

So we don’t break any HTTP specs by using path helper for redirect_to

You must be logged in to comment