File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/uk/gov/hmcts/cp/subscription/controllers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 22
33import lombok .RequiredArgsConstructor ;
44import lombok .extern .slf4j .Slf4j ;
5+ import org .jspecify .annotations .Nullable ;
56import org .springframework .http .HttpStatus ;
67import org .springframework .http .ResponseEntity ;
78import org .springframework .transaction .annotation .Transactional ;
@@ -27,12 +28,16 @@ public class SubscriptionController implements SubscriptionApi {
2728 @ Transactional
2829 public ResponseEntity <ClientSubscription > createClientSubscription (final String callbackUrl ,
2930 final CreateClientSubscriptionRequest request ) {
30- log .info ("createClientSubscription callbackUrl:{} clientId:{}" , callbackUrl , CLIENT_ID );
31+ log .info ("createClientSubscription callbackUrl:{} clientId:{}" , getSanitizedCallbackUrl ( callbackUrl ) , CLIENT_ID );
3132 final ClientSubscription response = subscriptionService .saveSubscription (callbackUrl , request );
3233 log .info ("createClientSubscription created subscription:{}" , response .getClientSubscriptionId ());
3334 return new ResponseEntity <>(response , HttpStatus .CREATED );
3435 }
3536
37+ private static @ Nullable String getSanitizedCallbackUrl (final String callbackUrl ) {
38+ return callbackUrl == null ? null : callbackUrl .replace ("\r " , " " ).replace ("\n " , " " );
39+ }
40+
3641 @ Override
3742 @ Transactional
3843 public ResponseEntity <ClientSubscription > updateClientSubscription (final UUID clientSubscriptionId ,
You can’t perform that action at this time.
0 commit comments