A Bragg grating assisted all-optical header pre-processor based on self-phase modulation in a semiconductor optical amplifier is presented. The operation principle is discussed and demonstrated on packets with an NRZ header at a data rate of 2.5 Gbit/s and a Manchester encoded payload at a data rate of 10 Gbit/s. It is also demonstrated that the header pre-processor improves the performance of an all-optical header processor based on two-pulse correlation in a SLALOM configuration.