Skip to content

Commit 4aeaa40

Browse files
author
Manikanta Nallagatla
committed
Add more error
1 parent 5c3400e commit 4aeaa40

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/WebJobs.Script.WebHost/Controllers/InstanceController.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ public async Task<IActionResult> Assign([FromBody] HostAssignmentRequest hostAss
4141
if (string.IsNullOrEmpty(hostAssignmentContext.EncryptedContext) &&
4242
(hostAssignmentContext?.AssignmentContext == null || hostAssignmentContext.AssignmentContext == null))
4343
{
44-
return BadRequest("Assignment context and EncryptedContext is missing.");
44+
return BadRequest("Atleast one of Assignment context and EncryptedContext needs to be set.");
45+
}
46+
if (!string.IsNullOrEmpty(hostAssignmentContext.EncryptedContext) &&
47+
!(hostAssignmentContext?.AssignmentContext == null || hostAssignmentContext.AssignmentContext == null))
48+
{
49+
return BadRequest("Only one of Assignment context and EncryptedContext needs to be set.");
4550
}
4651

4752
var debugMessage = (hostAssignmentContext.EncryptedContext.Length > 0) ? "ContextLength is : " + hostAssignmentContext.EncryptedContext.Length : "Using unencrypted assignment context";

0 commit comments

Comments
 (0)