Skip to content

Commit

Permalink
fix list submission to support utf8 json
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveALee committed Aug 5, 2022
1 parent 2713da1 commit 4f49cdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _functions/list-submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function callGitHubWebhook(formData) {
headers: {
'User-Agent': `W3C WAI Website ${repository}`,
Accept: 'application/vnd.github.v3+json',
'Content-Type': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
Authorization: `Bearer ${process.env.GITHUB_PAT}`,
'Content-Length': reqBody.length,
},
Expand Down Expand Up @@ -88,7 +88,7 @@ exports.handler = async function (event, context) {
const response = (code, redir, body) =>
({ statusCode: redir ? 303 : code, // this is the correct redirect code, UA will GET the location header
// TODO check if Access-Control-Allow-Origin is actually needed or if can make more specific
headers: { ...{"content-type": "application/json", "Access-Control-Allow-Origin": "*"}, ...(redir ? { "Location": redir } : {}) },
headers: { ...{"content-type": "application/json;charset=UTF-8", "Access-Control-Allow-Origin": "*"}, ...(redir ? { "Location": redir } : {}) },
body: body ? JSON.stringify(body, null, ' ') : ''
})

Expand Down

0 comments on commit 4f49cdc

Please sign in to comment.