Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2025 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -231,25 +231,29 @@ public void setSuspendTimeout(final long timeOut, final TimeUnit timeUnit) throw
public OutputStream writeResponseStatusAndHeaders(final long contentLength,
final ContainerResponse context)
throws ContainerException {
try {
final javax.ws.rs.core.Response.StatusType statusInfo = context.getStatusInfo();
if (statusInfo.getReasonPhrase() == null) {
grizzlyResponse.setStatus(statusInfo.getStatusCode());
} else {
grizzlyResponse.setStatus(statusInfo.getStatusCode(), statusInfo.getReasonPhrase());
}
if (!grizzlyResponse.isCommitted()) {
try {
final javax.ws.rs.core.Response.StatusType statusInfo = context.getStatusInfo();
if (statusInfo.getReasonPhrase() == null) {
grizzlyResponse.setStatus(statusInfo.getStatusCode());
} else {
grizzlyResponse.setStatus(statusInfo.getStatusCode(), statusInfo.getReasonPhrase());
}

grizzlyResponse.setContentLengthLong(contentLength);
grizzlyResponse.setContentLengthLong(contentLength);

for (final Map.Entry<String, List<String>> e : context.getStringHeaders().entrySet()) {
for (final String value : e.getValue()) {
grizzlyResponse.addHeader(e.getKey(), value);
for (final Map.Entry<String, List<String>> e : context.getStringHeaders().entrySet()) {
for (final String value : e.getValue()) {
grizzlyResponse.addHeader(e.getKey(), value);
}
}
}

return grizzlyResponse.getOutputStream();
} finally {
logger.debugLog("{0} - writeResponseStatusAndHeaders() called", name);
return grizzlyResponse.getOutputStream();
} finally {
logger.debugLog("{0} - writeResponseStatusAndHeaders() called", name);
}
} else {
return null;
}
}

Expand Down
Loading