{"push_id":2440481743,"size":2,"distinct_size":0,"ref":"refs/heads/release","head":"c254ae8199b4f90e8a3f5c768310f93496cacc02","before":"16b3f40e72cff454d853fc0b2ca7f3109c9426e9","commits":[{"sha":"9dfe45928c32f84a63fbf2a12dc6e2d5377b15d8","author":{"name":"Chris Roos","email":"4181b934c2715a2bba60cdb3cc1b35b2777d1c23@seagul.co.uk"},"message":"Fix attachment redirect when filename contains multiple periods\n\nWe received numerous support requests about attachments not being\naccessible after deploying PR 3918[1] earlier today.\n\nThe problem was caused by the explicit `:extension` segment in the\nroutes. Its presence meant that filenames containing multiple periods\n(e.g. 'filename.foo.bar') would be parsed and result in:\n\n* params[:path] being set to 'filename',\n* params[:extension] being set to 'foo'\n* params[:format] being set to 'bar'\n\nI don't fully understand why but calling `redirect_to host: asset_host`\nwhen params contains both an `extension` and `format` results in the\n`format` being dropped. You can see this in the example below (note that\nthe .pdf has been dropped):\n\n    curl -v \"https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/637057/Rural_Land_and_Entitlements__RLE1__V1.0_2016.pdf\"\n    < HTTP/2 302\n    < location: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/637057/Rural_Land_and_Entitlements__RLE1__V1.0_2016\n\nI came across this previously when doing something similar with the\nnon-attachment assets. That was fixed in PR 3627[2].\n\nI started out trying to write a functional test for the\nAttachmentsController but that wasn't easy because I have to specify the\nparameters individually. I've gone with an integration test as it allows\nme to request the path using a string.\n\n[1]: https://github.com/alphagov/whitehall/pull/3918\n[2]: https://github.com/alphagov/whitehall/pull/3627/commits/98bb15f5fed3c735f4f601227d331c0b41dcd924","distinct":false,"url":"https://api.github.com/repos/alphagov/whitehall/commits/9dfe45928c32f84a63fbf2a12dc6e2d5377b15d8"},{"sha":"c254ae8199b4f90e8a3f5c768310f93496cacc02","author":{"name":"Chris Roos","email":"4181b934c2715a2bba60cdb3cc1b35b2777d1c23@seagul.co.uk"},"message":"Merge pull request #3933 from alphagov/fix-broken-attachment-redirects\n\nFix redirect when filename contains multiple periods","distinct":false,"url":"https://api.github.com/repos/alphagov/whitehall/commits/c254ae8199b4f90e8a3f5c768310f93496cacc02"}]}
{"actor":{"display_login":"govuk-ci"}}