[Doh] Hackathon javascript client & browser issue

Tom Pusateri <pusateri@bangj.com> Sun, 18 March 2018 14:11 UTC

Return-Path: <pusateri@bangj.com>
X-Original-To: doh@ietfa.amsl.com
Delivered-To: doh@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 202A112783A for <doh@ietfa.amsl.com>; Sun, 18 Mar 2018 07:11:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nNoGA6AkUlRB for <doh@ietfa.amsl.com>; Sun, 18 Mar 2018 07:11:02 -0700 (PDT)
Received: from oj.bangj.com (amt0.gin.ntt.net [129.250.11.170]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9280812711A for <doh@ietf.org>; Sun, 18 Mar 2018 07:11:02 -0700 (PDT)
Received: from dhcp-86a7.meeting.ietf.org (dhcp-86a7.meeting.ietf.org [31.133.134.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by oj.bangj.com (Postfix) with ESMTPSA id 7EAED886 for <doh@ietf.org>; Sun, 18 Mar 2018 10:05:49 -0400 (EDT)
From: Tom Pusateri <pusateri@bangj.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Message-Id: <07A79B82-9B30-4BA6-96C8-175707581178@bangj.com>
Date: Sun, 18 Mar 2018 14:10:59 +0000
To: doh@ietf.org
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/doh/GqjyRtO_Ahg2un7szTOVdVNpZh8>
Subject: [Doh] Hackathon javascript client & browser issue
X-BeenThere: doh@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: DNS Over HTTPS <doh.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/doh>, <mailto:doh-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/doh/>
List-Post: <mailto:doh@ietf.org>
List-Help: <mailto:doh-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/doh>, <mailto:doh-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 18 Mar 2018 14:11:04 -0000

Working in the hackathon, I created a simple node javascript client to test DoH.

https://github.com/pusateri/doh-client

This works fine and then Stéphane asked if it could run in the browser. So I did this:

https://github.com/pusateri/doh-webpack

However, when sending a POST to a test server, I am getting a error (400) response to an initial pre-flight OPTIONS request.

According to https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests

The only content types allowed for a POST are:

	• application/x-www-form-urlencoded
	• multipart/form-data
	• text/plain

so a question I have, should the DoH servers respond to a pre-flight OPTIONS method or are things working as designed because this shouldn’t be allowed to run in a browser?

Thanks,
Tom