Skip to content

Commit e5642d0

Browse files
committed
Adding comments, stop logging CORS
1 parent 8203525 commit e5642d0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

stubbornjava-common/src/main/java/com/stubbornjava/common/GraphiteHttpSender.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
import okhttp3.logging.HttpLoggingInterceptor;
1818
import okhttp3.logging.HttpLoggingInterceptor.Level;
1919

20+
// {{start:sender}}
21+
/**
22+
* This is a hacked together HTTP sender for grafana cloud.
23+
* This is NOT the recommended approach to collect metrics.
24+
* The recommended approach is to use a Carbon-Relay-NG.
25+
* @author billoneil
26+
*
27+
*/
2028
class GraphiteHttpSender implements GraphiteSender {
2129
private static final Logger log = LoggerFactory.getLogger(GraphiteHttpSender.class);
2230

@@ -106,3 +114,4 @@ public long getTime() {
106114
}
107115
}
108116
}
117+
// {{end:sender}}

stubbornjava-common/src/main/java/com/stubbornjava/common/undertow/handlers/CustomHandlers.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ public static HttpHandler corsOriginWhitelist(HttpHandler next, Set<String> orig
175175
String origin = Exchange.headers()
176176
.getHeader(exchange, Headers.ORIGIN)
177177
.orElse("");
178-
log.debug("Origin: {} Whitelist: {}", origin, originWhitelist);
179178
if (originWhitelist.contains(origin)) {
180-
log.debug("Origin whitelist matched adding CORS header");
181179
Exchange.headers().setHeader(exchange, "Access-Control-Allow-Origin", origin);
182180
}
183181
next.handleRequest(exchange);

0 commit comments

Comments
 (0)