Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: report SVG values without quotes #981

Merged
merged 4 commits into from
May 11, 2023

Conversation

danielpeintner
Copy link
Member

fixes #965

@danielpeintner
Copy link
Member Author

Note: I think it is a very hack fix and I am not sure what we can/should to else.

Buffer.from("XXX");

returns a buffer of the XXX string around with quotes.

@danielpeintner danielpeintner requested a review from relu91 May 10, 2023 07:10
Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked https://datatracker.ietf.org/doc/html/rfc822#appendix-A and it seems that also text/plain does not require quotes around the body, so I think we can get rid of the boolean modifier and always return the unquoted value.

Also as a solution to the issue, instead of checking if the value in input is a string and doing Buffer manipulation, why don't we do something like the following:

        let body = "";
        if (value !== undefined) {
           if (typeof(value) === 'string') {
             body = value
          } else {
              body = JSON.stringify(value)
          }
       }

always write buffer directly without quotes and simplify code
@danielpeintner
Copy link
Member Author

@relu91 I integrated you proposed changes. Please have a look.

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@relu91 relu91 merged commit fb2c2aa into eclipse-thingweb:master May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

counter example: countAsImage property has wrong contentType in TD
2 participants