Skip to content

Commit

Permalink
Set content-type header for all form submission requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
acsbendi committed May 29, 2022
1 parent f69ee3c commit 0ef8db4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ internal class RequestInspectorJavaScriptInterface(webView: WebView) {

val body = when (enctype) {
"application/x-www-form-urlencoded" -> {
headerMap["content-type"] = enctype
getUrlEncodedFormBody(formParameterJsonArray)
}
"multipart/form-data" -> {
headerMap["content-type"] = "multipart/form-data; boundary=$MULTIPART_FORM_BOUNDARY"
getMultiPartFormBody(formParameterJsonArray)
}
"text/plain" -> {
headerMap["content-type"] = enctype
getPlainTextFormBody(formParameterJsonArray)
}
else -> {
Expand Down

0 comments on commit 0ef8db4

Please sign in to comment.