Return Location in resp header for notif subscrip
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / NormalizedNodeJsonBodyWriter.java
index 67fea4db2f9cb68f8d4943f2e71c051f46dfe1d1..ec3df98aea5ea04074ccd2fc45c45e5c04fbbf01 100644 (file)
@@ -17,6 +17,7 @@ import java.lang.reflect.Type;
 import java.net.URI;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
@@ -95,6 +96,12 @@ public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter<Normalize
             jsonWriter.endObject();
             jsonWriter.flush();
         }
+
+        if (httpHeaders != null) {
+            for (final Map.Entry<String, Object> entry : context.getNewHeaders().entrySet()) {
+                httpHeaders.add(entry.getKey(), entry.getValue());
+            }
+        }
     }
 
     private static void writeNormalizedNode(final JsonWriter jsonWriter,