When assiging a status code to your writer header, you should also set it in your context. This way, you can read your status code from anywhere.