2021-12-03 Fred Gleason <fredg@paravelsystems.com>

* Modified the 'rivwebpyapi' so as to require only scheme and host
	parts of the URL provided to the 'url' parameter.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-12-03 14:22:29 -05:00
parent 04ea0f0ca6
commit 14caa317e0
2 changed files with 14 additions and 2 deletions

View File

@ -22612,3 +22612,6 @@
2021-11-11 Fred Gleason <fredg@paravelsystems.com> 2021-11-11 Fred Gleason <fredg@paravelsystems.com>
* Removed debugging code from 'web/rdxport/carts.cpp'. * Removed debugging code from 'web/rdxport/carts.cpp'.
* Removed debugging code from 'apis/rivwebpyapi/api/rivwebpyapi.py'. * Removed debugging code from 'apis/rivwebpyapi/api/rivwebpyapi.py'.
2021-12-03 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'rivwebpyapi' so as to require only scheme and host
parts of the URL provided to the 'url' parameter.

View File

@ -23,6 +23,7 @@ import sys
import datetime import datetime
from datetime import timedelta from datetime import timedelta
import requests import requests
from urllib.parse import urlparse
from xml.sax.handler import ContentHandler from xml.sax.handler import ContentHandler
import xml.sax import xml.sax
@ -186,14 +187,22 @@ class rivwebpyapi(object):
Takes three arguments: Takes three arguments:
url - The URL of the service. Typically of the form url - The URL of the service. Typically of the form
'http://rivendell.example.com/rd-bin/rdxport.cgi' (string). 'http://rivendell.example.com' (string).
username - The Rivendell Username to connect as (string). username - The Rivendell Username to connect as (string).
password - The password for the specified Rivendell Username password - The password for the specified Rivendell Username
(string). (string).
""" """
self.__connection_url=url #
# Normalize the URL
#
parsed_url=urlparse(url)
parsed_url=parsed_url._replace(path='/rd-bin/rdxport.cgi',
params='',
query='',
fragment='')
self.__connection_url=parsed_url.geturl()
self.__connection_username=username self.__connection_username=username
self.__connection_password=password self.__connection_password=password