Skip to content

Commit 1cb3e73

Browse files
committed
better servlet (3.0) specific API testability
1 parent 2732d8c commit 1cb3e73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/jruby/rack/servlet/ResponseCapture.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public boolean isHandled(final HttpServletRequest request) {
231231
return false;
232232
}
233233
for ( final String headerName : headerNames ) {
234-
if ( ! "Allow".equals(headerName) ) {
234+
if ( ! "Allow".equals( headerName ) ) {
235235
return handled = true; // not just Allow header - consider handled
236236
}
237237
}
@@ -274,8 +274,8 @@ public boolean isOutputAccessed() {
274274
private Collection<String> getHeaderNamesOrNull() {
275275
// NOTE: getHeaderNames since Servlet API 3.0 JRuby-Rack 1.1 still supports 2.5
276276
try {
277-
final Method getHeaderNames = HttpServletResponse.class.getMethod("getHeaderNames");
278-
return (Collection<String>) getHeaderNames.invoke(this);
277+
final Method getHeaderNames = getResponse().getClass().getMethod("getHeaderNames");
278+
return (Collection<String>) getHeaderNames.invoke( getResponse() );
279279
}
280280
catch (NoSuchMethodException e) { return null; }
281281
catch (IllegalAccessException e) { return null; }

0 commit comments

Comments
 (0)