File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed
engine/src/main/scala/cromwell/webservice Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,23 @@ trait SwaggerUiHttpService {
2323 | operationsSorter: "alpha"
2424 """ .stripMargin
2525
26- mapResponseEntity { entityFromJar =>
27- entityFromJar.transformDataBytes(Flow .fromFunction[ByteString , ByteString ] { original : ByteString =>
28- ByteString (
29- original.utf8String
30- .replace(""" url: "https://petstore.swagger.io/v2/swagger.json"""" , " url: 'cromwell.yaml'" )
31- .replace(""" layout: "StandaloneLayout"""" , s """ layout: "StandaloneLayout", $swaggerOptions""" )
32- )
33- })
26+ // Fix Issue #7763: Must intercept 304 BEFORE mapResponseEntity tries to transform it
27+ mapResponse { response =>
28+ if (response.status == StatusCodes .NotModified ) {
29+ // For 304, return immediately with empty entity, don't try to transform
30+ response.withEntity(HttpEntity .Empty )
31+ } else {
32+ // For 200, transform the entity content
33+ response.mapEntity { entityFromJar =>
34+ entityFromJar.transformDataBytes(Flow .fromFunction[ByteString , ByteString ] { original : ByteString =>
35+ ByteString (
36+ original.utf8String
37+ .replace(""" url: "https://petstore.swagger.io/v2/swagger.json"""" , " url: 'cromwell.yaml'" )
38+ .replace(""" layout: "StandaloneLayout"""" , s """ layout: "StandaloneLayout", $swaggerOptions""" )
39+ )
40+ })
41+ }
42+ }
3443 } {
3544 getFromResource(s " $resourceDirectory/index.html " )
3645 }
You can’t perform that action at this time.
0 commit comments