Skip to content
Permalink
Branch: master
Commits on Feb 23, 2019
  1. Use existing character set in POST body when possible (#23603)

    nhunzaker authored and facebook-github-bot committed Feb 23, 2019
    Summary:
    This commit fixes a bug introduced in a previous attempt (#23580) to address an issue where okhttp appended `charset=utf-8` to the Content-Type header when otherwise not specified.
    
    In that commit, I converted all characters to UTF-8, however it should instead use an existing encoding when possible.
    
    Related issues:
    #8237 (comment)
    
    [Android][fixed] - Respect existing character set when specified in fetch() POST request
    Pull Request resolved: #23603
    
    Differential Revision: D14191750
    
    Pulled By: hramos
    
    fbshipit-source-id: 11c1bfd98ccd33cd8e54ea426285b7d2ce9c2d7c
Commits on Feb 22, 2019
  1. Prevent okhttp from adding ;charset=utf8 to ContentType Header (#23580)

    nhunzaker authored and facebook-github-bot committed Feb 22, 2019
    Summary:
    Before this commit, `fetch()` calls append `"charset=utf8"` to the `Content-Type` header on Android (and not on iOS). This is because of an implementation detail in the okhttp library. This means that you can make a call on the JavaScript side like:
    
    ```javascript
    let body = JSON.stringify({ key: "value" });
    
    let headers = {
      "Content-Type": "application/json"
    };
    
    fetch("http://10.0.2.2:3000", { method: "POST", body, headers });
    ```
    
    However the resulting request appends the utf8 character:
    
    ```
    POST - 13:34:32:
      content-type: application/json; charset=utf-8
      content-length: 15
      host: 10.0.2.2:3000
      connection: Keep-Alive
      accept-encoding: gzip
      user-agent: okhttp/3.12.1
    ```
    
    Passing byte array into the RequestBody avoids this, as recommended by a maintainer of okhttp:
    
    square/okhttp#2099 (comment)
    
    Related issues:
    #8237
    
    [Android][fixed] - Prevent fetch() POST requests on Android from appending `charset=utf-8` to `Content-Type` header.
    Pull Request resolved: #23580
    
    Differential Revision: D14180849
    
    Pulled By: cpojer
    
    fbshipit-source-id: b84cadf83361331a9f64d1ff5f2e6399a55527a6
Commits on Mar 5, 2016
  1. Replace "Bad: will fatal" with "Bad: will fail" in Text.md

    nhunzaker authored and Facebook Github Bot 6 committed Mar 5, 2016
    Summary:This commit makes a change to a comment in `Text.md` related to documenting that all text nodes must be wrapped in a `<Text />` component.
    
    I know this is super small, but it was so easy to handle this on Github that I went ahead and did it.
    Closes #6310
    
    Differential Revision: D3016460
    
    Pulled By: vjeux
    
    fb-gh-sync-id: 9cf861c44961c285971ec22489fbf48c16620a5f
    shipit-source-id: 9cf861c44961c285971ec22489fbf48c16620a5f
You can’t perform that action at this time.