The velocity of a two-dimensional aqueous foam has been measured as it flows through two parallel channels, at a constant overall volumetric flow rate. The flux distribution between the two channels is studied as a function of the ratio of their widths. A peculiar dependence of the velocity ratio on the width ratio is observed when the foam structure in the narrower channel is either single staircase or bamboo. In particular, discontinuities in the velocity ratios are observed at the transitions between double and single staircase and between single staircase and bamboo. A theoretical model accounting for the viscous dissipation at the solid wall and the capillary pressure across a film pinned at the channel outlet predicts the observed non-monotonic evolution of the velocity ratio as a function of the width ratio. It also predicts quantitatively the intermittent temporal evolution of the velocity in the narrower channel when it is so narrow that film pinning at its outlet repeatedly brings the flow to a near stop.