Title: add safeguards against invalid raw json strings by csantero · Pull Request #44 · JSONAPIdotNET/JSONAPI.NET · GitHub
Open Graph Title: add safeguards against invalid raw json strings by csantero · Pull Request #44 · JSONAPIdotNET/JSONAPI.NET
X Title: add safeguards against invalid raw json strings by csantero · Pull Request #44 · JSONAPIdotNET/JSONAPI.NET
Description: I realized that my code that serializes raw JSON down from the database has no protections to ensure that the data is actually valid JSON. If it's malformed in any way, the formatter will happily send it onto the wire and the client will choke on the response. I added a check that validates raw json properties before they are serialized. If the property value contains unparseable syntax, like { x }, then the entire object will be sent down as an empty hash {}. If the property value contains unquoted keys, then the keys will be quoted. So { foo: 3 } will be serialized as { "foo": 3 }. (I originally wanted to have the same behavior if we detect unquoted keys as if the JSON is malformed. But I don't think it's possible to make Json.NET do this - the JToken parser just converts the unquoted keys into quoted ones instead of throwing an exception.)
Open Graph Description: I realized that my code that serializes raw JSON down from the database has no protections to ensure that the data is actually valid JSON. If it's malformed in any way, the formatter will happi...
X Description: I realized that my code that serializes raw JSON down from the database has no protections to ensure that the data is actually valid JSON. If it's malformed in any way, the formatter will h...
Opengraph URL: https://github.com/JSONAPIdotNET/JSONAPI.NET/pull/44
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3e5bdc2c-f23a-91f2-db95-e3c13ee123b2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B5DC:1B2073:1CF1EFF:2667B86:6A52DA2C |
| html-safe-nonce | 2164571ed74ccb3be59007c5ea1691724e7b3749378342e1abe3ab44a7003758 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNURDOjFCMjA3MzoxQ0YxRUZGOjI2NjdCODY6NkE1MkRBMkMiLCJ2aXNpdG9yX2lkIjoiODk4ODM1MTM4OTU0Njc2NDg0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5f97faaeda246681bbc1251e6b684b4c826fb2ce245d67f623fb407bad786896 |
| hovercard-subject-tag | pull_request:28509530 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JSONAPIdotNET/JSONAPI.NET/pull/44/files |
| twitter:image | https://avatars.githubusercontent.com/u/828286?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/828286?s=400&v=4 |
| og:image:alt | I realized that my code that serializes raw JSON down from the database has no protections to ensure that the data is actually valid JSON. If it's malformed in any way, the formatter will happi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JSONAPIdotNET/JSONAPI.NET git https://github.com/JSONAPIdotNET/JSONAPI.NET.git |
| octolytics-dimension-user_id | 16112275 |
| octolytics-dimension-user_login | JSONAPIdotNET |
| octolytics-dimension-repository_id | 27474358 |
| octolytics-dimension-repository_nwo | JSONAPIdotNET/JSONAPI.NET |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27474358 |
| octolytics-dimension-repository_network_root_nwo | JSONAPIdotNET/JSONAPI.NET |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width