Implemented checking of Origin header. Added documentation.