Skip to content

Commit 7c0f26b

Browse files
committed
Drop / in blocked endpoints
1 parent 3930e55 commit 7c0f26b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/edu/harvard/iq/dataverse/api/ApiBlockingFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private void updateBlockedPoints() {
135135
for ( String endpoint : endpointList.split(",") ) {
136136
String endpointPrefix = canonize(endpoint);
137137
if ( ! endpointPrefix.isEmpty() ) {
138-
endpointPrefix = endpointPrefix + "/";
138+
endpointPrefix = endpointPrefix;
139139
logger.log(Level.INFO, "Blocking API endpoint: {0}", endpointPrefix);
140140
blockedApiEndpoints.add(endpointPrefix);
141141
}
@@ -154,6 +154,7 @@ public void doFilter(ServletRequest sr, ServletResponse sr1, FilterChain fc) thr
154154
HttpServletRequest hsr = (HttpServletRequest) sr;
155155
String requestURI = hsr.getRequestURI();
156156
String apiEndpoint = canonize(requestURI.substring(hsr.getServletPath().length()));
157+
logger.info("ApiEndpoint: " + apiEndpoint);
157158
for ( String prefix : blockedApiEndpoints ) {
158159
if ( apiEndpoint.startsWith(prefix) ) {
159160
getBlockPolicy().doBlock(sr, sr1, fc);

0 commit comments

Comments
 (0)