From reviews-return-20668-archive-asf-public=cust-asf.ponee.io@aurora.apache.org Wed Feb 28 06:23:23 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2395B180651 for ; Wed, 28 Feb 2018 06:23:22 +0100 (CET) Received: (qmail 57168 invoked by uid 500); 28 Feb 2018 05:23:21 -0000 Mailing-List: contact reviews-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@aurora.apache.org Delivered-To: mailing list reviews@aurora.apache.org Received: (qmail 57124 invoked by uid 99); 28 Feb 2018 05:23:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2018 05:23:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 1B2E31A01C0; Wed, 28 Feb 2018 05:23:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.69 X-Spam-Level: X-Spam-Status: No, score=0.69 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8GlASqSq4blX; Wed, 28 Feb 2018 05:23:17 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 8D3385F3B5; Wed, 28 Feb 2018 05:23:17 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1CEA8E00D4; Wed, 28 Feb 2018 05:23:17 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id B0186C4038A; Wed, 28 Feb 2018 05:23:16 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============9207522013109928857==" MIME-Version: 1.0 Subject: Re: Review Request 65761: Use StandardCharset instead of Charset.forName in ApiModule From: Renan DelValle To: Renan DelValle Cc: Aurora , Jordan Ly Date: Wed, 28 Feb 2018 05:23:16 -0000 Message-ID: <20180228052316.24776.98053@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Renan DelValle X-ReviewGroup: Aurora X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/65761/ X-Sender: Renan DelValle References: <20180222232338.10815.78623@reviews-vm2.apache.org> In-Reply-To: <20180222232338.10815.78623@reviews-vm2.apache.org> Reply-To: Renan DelValle X-ReviewRequest-Repository: aurora --===============9207522013109928857== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65761/#review198375 ----------------------------------------------------------- Tested on incognito window in Chrome 64, private window in Firefox 58, and private window in Safari 11.0.3. Used incognito/private windows to avoid javascript caches influencing outcome. Only thing I would change in this patch is modifying `testThriftJsonUtf8Accepted` in `org/apache/aurora/scheduler/http/api/ApiIT.java` to something like: ``` String upperUTF8 = StandardCharsets.UTF_8.name().toUpperCase(); String lowerUTF8 = StandardCharsets.UTF_8.name().toLowerCase(); // We also want to ensure charset parsing is case-insensitive because different browsers have // different default behaviors (Chrome and Safari will change charset to all uppercase, while // Firefox may leave it lowercase. ClientResponse upperCaseUTF = getPlainRequestBuilder(ApiModule.API_PATH) .type("application/vnd.apache.thrift.json; charset=" + upperUTF8) .accept("application/vnd.apache.thrift.json; charset=" + upperUTF8) .post(ClientResponse.class, JSON_FIXTURE); assertEquals(SC_OK, upperCaseUTF.getStatus()); assertEquals( "application/vnd.apache.thrift.json", upperCaseUTF.getHeaders().getFirst(CONTENT_TYPE)); ClientResponse lowerCaseUTF = getPlainRequestBuilder(ApiModule.API_PATH) .type("application/vnd.apache.thrift.json; charset=" + lowerUTF8) .accept("application/vnd.apache.thrift.json; charset=" + lowerUTF8) ``` just so we are basing our test on something we depend on in the main source. Other than that looks good to me! - Renan DelValle On Feb. 22, 2018, 3:23 p.m., Jordan Ly wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65761/ > ----------------------------------------------------------- > > (Updated Feb. 22, 2018, 3:23 p.m.) > > > Review request for Aurora and Renan DelValle. > > > Repository: aurora > > > Description > ------- > > Minor nit, use the StandardCharset constant for UTF-8 as opposed to creating it ourselves. > > > Diffs > ----- > > src/main/java/org/apache/aurora/scheduler/http/api/ApiModule.java 09950a77427c7ed94090a036ae26dae2939aa2c1 > > > Diff: https://reviews.apache.org/r/65761/diff/1/ > > > Testing > ------- > > `./gradlew test` > > Manually verified Firefox, Chrome, and Safari. > > > Thanks, > > Jordan Ly > > --===============9207522013109928857==--