Escape underscores when sending ZPL to render service [SCI-7223] (#4456)

This commit is contained in:
ajugo 2022-09-26 10:21:12 +02:00 committed by GitHub
parent 5a06a685aa
commit 8c2f7da87f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ class LabelTemplatesPreviewService
invocation_type: 'RequestResponse',
log_type: 'Tail',
payload:
"{ \"content\": #{@params[:zpl].to_json},"\
"{ \"content\": #{sanitize_zpl_code(@params[:zpl]).to_json},"\
"\"width\": #{@params[:width]},"\
"\"height\": #{@params[:height]},"\
"\"density\": #{@params[:density]} "\
@ -30,4 +30,10 @@ class LabelTemplatesPreviewService
@error = resp.function_error.string
end
end
private
def sanitize_zpl_code(zpl_code)
zpl_code.gsub!('_', '_5F')
end
end