Skip to content

Commit

Permalink
support HttpAcct Authorization header with PTlib HTTP client, too
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Feb 20, 2023
1 parent ca518b4 commit 520a55f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Changes from 5.10 to 5.11
=========================
- fix bug with H.245 address and UDP source when using ExternalIP=
- fix bug with H.245 address and UDP source when using ExternalIP= switch
- remove non-working command line switch -e / --externalip, use config file to set ExternalIP
- new accounting variables %{registrations}, %{calls}, %{total-calls}, %{successful-calls}, %{allocated-bandwidth}
- new switch [HttpAcct] Authorization= to send authorization headers to support InfluxDB
(GnuGk needs to be compiled with libcurl)
- replace \r and \n in HttpAcct body with carriage return and line feed characters
- BUGFIX(Toolkit.cxx) fix tracing of port notifications
- new switch: [RasSrv::LRQFeatures] PreserveDestination=1
- new switch: [RasSrv::LRQFeatures] PreserveDestination=1 (helpful when calling Pexip servers)

Changes from 5.9 to 5.10
========================
Expand Down
1 change: 0 additions & 1 deletion docs/manual/acct.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@ The content type header to send in POST requests.
Default: <tt>N/A</tt><newline>
<p>
The authorization header to send in HTTP requests.
GnuGk must be compiled with libcurl support for this.

<item><tt/TimestampFormat=MySQL/<newline>
Default: <tt>N/A</tt><newline>
Expand Down
3 changes: 3 additions & 0 deletions httpacct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ GkAcctLogger::Status HttpAcct::HttpLog(PString url, PString body)
body.Replace("\\r", cr, true);
PMIMEInfo outMIME;
outMIME.SetAt(PMIMEInfo::ContentTypeTag(), (const char *)m_contentType);
if (!m_authorization.IsEmpty()) {
outMIME.SetAt("Authorization", (const char *)m_authorization);
}
PMIMEInfo replyMIME;
if (!http.PostData(url, outMIME, body, replyMIME, result)) {
PTRACE(2, "HttpAcct\tCould not POST to " << host);
Expand Down

0 comments on commit 520a55f

Please sign in to comment.