sstephenson / sprockets

Rack-based asset packaging system
2.55k stars 24 forks source link

404 on HEAD requests #729

Closed ddgromit closed 9 years ago

ddgromit commented 9 years ago

It seems that locally the asset pipeline only responds to GET requests, not HEAD requests.

GET:

curl 'http://localhost:3000/assets/scriptcam.swf' -X GET -I
HTTP/1.1 200 OK

HEAD:

curl 'http://localhost:3000/assets/scriptcam.swf' -X HEAD -I
HTTP/1.1 404 Not Found

This problem came up because a library I'm using (scriptcam.js) does a HEAD request to check if the file exists first before doing a full GET. In production, it works fine because the files are served up by nginx which knows how to respond to both methods.

Not sure if this should be tagged as a feature request or bug report. It's fairly easy to workaround but it would be nice to be able to have local mirror standard production capabilities.

ddgromit commented 9 years ago

Ah didn't realize this repo isn't the primary one. Moving this issue to https://github.com/rails/sprockets/issues/63