Skip to content

Commit 520a55f

Browse files
committed
support HttpAcct Authorization header with PTlib HTTP client, too
1 parent ca518b4 commit 520a55f

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

changes.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
Changes from 5.10 to 5.11
22
=========================
3-
- fix bug with H.245 address and UDP source when using ExternalIP=
3+
- fix bug with H.245 address and UDP source when using ExternalIP= switch
44
- remove non-working command line switch -e / --externalip, use config file to set ExternalIP
55
- new accounting variables %{registrations}, %{calls}, %{total-calls}, %{successful-calls}, %{allocated-bandwidth}
66
- new switch [HttpAcct] Authorization= to send authorization headers to support InfluxDB
7-
(GnuGk needs to be compiled with libcurl)
87
- replace \r and \n in HttpAcct body with carriage return and line feed characters
98
- BUGFIX(Toolkit.cxx) fix tracing of port notifications
10-
- new switch: [RasSrv::LRQFeatures] PreserveDestination=1
9+
- new switch: [RasSrv::LRQFeatures] PreserveDestination=1 (helpful when calling Pexip servers)
1110

1211
Changes from 5.9 to 5.10
1312
========================

docs/manual/acct.sgml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,6 @@ The content type header to send in POST requests.
10781078
Default: <tt>N/A</tt><newline>
10791079
<p>
10801080
The authorization header to send in HTTP requests.
1081-
GnuGk must be compiled with libcurl support for this.
10821081

10831082
<item><tt/TimestampFormat=MySQL/<newline>
10841083
Default: <tt>N/A</tt><newline>

httpacct.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ GkAcctLogger::Status HttpAcct::HttpLog(PString url, PString body)
257257
body.Replace("\\r", cr, true);
258258
PMIMEInfo outMIME;
259259
outMIME.SetAt(PMIMEInfo::ContentTypeTag(), (const char *)m_contentType);
260+
if (!m_authorization.IsEmpty()) {
261+
outMIME.SetAt("Authorization", (const char *)m_authorization);
262+
}
260263
PMIMEInfo replyMIME;
261264
if (!http.PostData(url, outMIME, body, replyMIME, result)) {
262265
PTRACE(2, "HttpAcct\tCould not POST to " << host);

0 commit comments

Comments
 (0)