only set allow_origin_pat if defined

fixes the default behavior to be as intended (require Origin == Host)
Merge pull request #6105 from minrk/default_allow_origin_pat

only set allow_origin_pat if defined