Content-Type header with Regular Expression Protection policy

For the GET request when Content-Type: application/json is added, it causes the following error:


{"fault":{"faultstring":"Failed to execute the RegularExpressionProtection StepDefinition RegularExpressionProtection.Injection. Reason: Unexpected token at position 0.","detail":{"errorcode":"steps.regexprotection.ExecutionFailed"}}}

Similarly for Content-Type: application/xml, the below is seen:

{"fault":{"faultstring":"Failed to execute the RegularExpressionProtection StepDefinition RegularExpressionProtection.Injection. Reason: Premature end of document while parsing at line 1(possibly around char 0)","detail":{"errorcode":"steps.regexprotection.ExecutionFailed"}}}

Whereas, a GET call without the content type returns a successful response.

Solved Solved
0 4 2,012
1 ACCEPTED SOLUTION

This is the expected behavior. The XPath will fail to extract if you do not pass a content type. Well, not "fail".. Actually it would do nothing. But it would be working as designed, though not working as you desire or expect.

This is the reason the GET call without the content type returns a 200 as it is doing nothing.

View solution in original post

4 REPLIES 4

This is the expected behavior. The XPath will fail to extract if you do not pass a content type. Well, not "fail".. Actually it would do nothing. But it would be working as designed, though not working as you desire or expect.

This is the reason the GET call without the content type returns a 200 as it is doing nothing.

@Stephen Gilson Can we have this documented?

@Akash Prabhashankar I added a new section to the doc here with this info.

Stephen