Skip to content

Commit

Permalink
chore: code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Apr 7, 2024
1 parent b70faf3 commit 18e9033
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions mods/edgeport/src/main/java/io/routr/GRPCSipListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static Request updateRequest(final Request request, final List<Header> headers)
var requestOut = (Request) request.clone();

Iterator<String> names = requestOut.getHeaderNames();

while (names.hasNext()) {
String n = names.next();
// WARN: Perhaps we should compute this value
Expand All @@ -188,18 +189,13 @@ static Request updateRequest(final Request request, final List<Header> headers)
}

for (Header header : headers) {
// Ignore special header
if (header.getName().equalsIgnoreCase("x-gateway-auth")) {
// Ignore special header that is used for authentication and Content-Length
if (header.getName().equalsIgnoreCase(ContentLength.NAME)
|| header.getName().equalsIgnoreCase("x-gateway-auth")) {
continue;
}

String s = header.getName();
if (s.equals(FromHeader.NAME) || s.equals(ToHeader.NAME) && s.equals(CallIdHeader.NAME)
&& s.equals(CSeqHeader.NAME)) {
requestOut.setHeader(header);
} else {
requestOut.addHeader(header);
}
requestOut.addHeader(header);
}

return requestOut;
Expand Down

0 comments on commit 18e9033

Please sign in to comment.