You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/11/26 16:08:59 UTC

[GitHub] mcdan commented on a change in pull request #4122: Protect Package Bindings from containing circular references

mcdan commented on a change in pull request #4122: Protect Package Bindings from containing circular references
URL: https://github.com/apache/incubator-openwhisk/pull/4122#discussion_r236317529
 
 

 ##########
 File path: core/controller/src/main/scala/org/apache/openwhisk/core/controller/Packages.scala
 ##########
 @@ -299,9 +299,14 @@ trait WhiskPackagesApi extends WhiskCollectionAPI with ReferencedEntities {
       case b: Binding =>
         val docid = b.fullyQualifiedName.toDocId
         logging.debug(this, s"fetching package '$docid' for reference")
-        getEntity(WhiskPackage.get(entityStore, docid), Some {
-          mergePackageWithBinding(Some { wp }) _
-        })
+        if (docid == wp.docid) {
+          logging.error(this, "unexpected package binding refers to itself: $docid")
+          terminate(InternalServerError)
 
 Review comment:
   Seems like a 422 is pretty spot on "422 UNPROCESSABLE ENTITY"
   
   https://tools.ietf.org/html/rfc4918#section-11.2
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services