mediawiki-utilities / python-mwapi

Simple Python Wrapper around MediaWiki API
http://pythonhosted.org/mwapi
MIT License
31 stars 11 forks source link

Add optional HTTP origin parameter to Session. #43

Open nosmo opened 3 years ago

nosmo commented 3 years ago

Interally within WMF we do not access the API servers via external hostnames, but we need to access the APIs for a given wiki via our internal appserver endpoint. Currently this is not possible as using the appserver hostname directly doesn't set a valid Host header for a wiki. This change adds an origin parameter to the Session object which allows the host to be used as the HTTP Host header while connecting to the IP or hostname of the given origin.