fix bug of adding accept headers multiple times, fix unit test