MER-C/wiki-java

support different protocol http/https

Closed this issue · 0 comments

Here's a proposed patch to allow "https" protocol. It's already been tested in mediawiki-japi.

private String prot="http";

/**
* Creates a new connection to a wiki with $wgScriptpath set to
* scriptPath.
*
* @param domain the wiki domain name
* @param scriptPath the script path
* @SInCE 0.14
*/
public Wiki(String domain, String scriptPath)
{
this("https",domain,scriptPath);
}

/**
 * initializer with protocol
 * @param prot
 * @param domain
 * @param scriptPath
 */
public Wiki(String prot, String domain,String scriptPath) {
  init(prot,domain,scriptPath);
}

/**
 * initialize me with the given protocol doman and scriptpath
 * @param prot
 * @param domain
 * @param scriptPath
 */
public void init(String prot,String domain,String scriptPath) {
    this.prot=prot;  

...
continue with original constructor that didn't have a prot ...

... use prot when doing initVars
protected void initVars()
{
StringBuilder basegen = new StringBuilder(prot+"://");