Fix expected status code when unauthorized to get post attachment