From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from mail-yw0-f183.google.com (mail-yw0-f183.google.com [209.85.161.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0C9791FBB0 for ; Mon, 24 Oct 2016 12:28:26 +0000 (UTC) Received: by mail-yw0-f183.google.com with SMTP id w3sf60219892ywg.0 for ; Mon, 24 Oct 2016 05:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=239KywCjbRZH8e9a/r8elhVMODZ1GzU3BZazrpiHCOo=; b=dJ2xgTnqoc7RpMQv7KmM9qqoSHnmsCgHmTav3PQTK4hfH6pr9JMali2ckg3/cpoVI4 ATjQoy6v8/HNBsVKCjAmko3CBc661vJpW4uD9eYMu4bdmFfJNXBFHTgOXdgVN1tOJsFa eKnyZLKFNjAmiRaKgc7gzbjURXG4/YCd1LmOXf74Wq/xgsc1cDspyf3DDd6mmcEr+woE oznhnT07UiSHj1HASo+3ZjV0yuGBrx91phyexMCOo0I6OP3rYozuDzR58KTMNXk6Irnx ygUhrEIqikJuzuvfD/PGK6/hioIDaa7ZJMa53BIyCKUEGaQt6q3CNLtCQbMWTabqaHRw nu+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=239KywCjbRZH8e9a/r8elhVMODZ1GzU3BZazrpiHCOo=; b=A/kJj8pfp3xwUhnoXPm5ZVufksTInd/MpZYvrH5Vw3ABvy3VtHbM3ly/LEGNCrgSQW zgR1IHvjQnIQar2C+7yxJdwBySI+M5RPImtfWZut4+MRVKkvBq3soj8JIpgP2IdsVFRO aemk5TtLc0065J5PUNBkZ/j+8dSYA/rDInJqVMMr0gloJkezMGcPdL+vNqRbflrgnOAR CSgOM/qYHrOd/qU6+7IAYLeXzprhtUUX5tJ/NwhmhPxxEhX3i3L/WC8ilG5qHE6Jdbhj hFLKdPJWCFrMARoH34qQVwcjVrCFRHcD8hENZJ/9jcRIC+hlCrOhZI45cO/1s+VW/lxt SRmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=239KywCjbRZH8e9a/r8elhVMODZ1GzU3BZazrpiHCOo=; b=Ikq0zHQb32YtRur3WqkqPxqEw7cv8q24GEDZCreocnTw9635VH8aFI9v9lCnfu6d3V 9qjZipXMRDZegKL8CGa4gb6fFa+I8mnY8Mc4d3GGAUabIWmMZ9rI4BAbLDZpIVOByY4d ght4x4LK2EunEi3KVncsH6RkpylCssfyRh647W1F6GjMJckzIg5J0jWHAHo1Dj2YevEO I+BlYLkgMU/AlfTJ2rGWc7MgQtD+JIB62OhY5tRtIRb9rL9ieMiw22H6+gRHHTrIMnz4 lj657og8874q05guu2n4tS2VPb7oxkjHrw0Epf6GyG6zLIdNqjstk74e5jN3JBJV35O6 M4Hg== Sender: rack-devel@googlegroups.com X-Gm-Message-State: ABUngvcKJufXg5WCJX/UU5IjR3ZXOmViit/mS5pTJrNkplWGTwKRic15GEO7X+aZmTjRsA== X-Received: by 10.36.57.9 with SMTP id l9mr43833ita.10.1477312105328; Mon, 24 Oct 2016 05:28:25 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.107.34.148 with SMTP id i142ls4036173ioi.7.gmail; Mon, 24 Oct 2016 05:28:24 -0700 (PDT) X-Received: by 10.36.124.149 with SMTP id a143mr41918itd.5.1477312104655; Mon, 24 Oct 2016 05:28:24 -0700 (PDT) Date: Mon, 24 Oct 2016 05:28:23 -0700 (PDT) From: Olivar Plays To: Rack Development Message-Id: In-Reply-To: References: <6c68f46f-fdc5-4cd3-b36c-9b2c6bf3e03e@googlegroups.com> Subject: Re: HTTP_ Headers from clients MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1258_1671240967.1477312103289" X-Original-Sender: arne.de.herdt@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , ------=_Part_1258_1671240967.1477312103289 Content-Type: multipart/alternative; boundary="----=_Part_1259_165408424.1477312103290" ------=_Part_1259_165408424.1477312103290 Content-Type: text/plain; charset=UTF-8 Alright, then we just need use some documentation and properly communicate this. At least I know where it stands now with Rack and can deal with it appropriately. Thank you for the information. Kind regards, Arne Op maandag 24 oktober 2016 14:25:15 UTC+2 schreef Lin Jen-Shin: > > Hi, > > On Mon, Oct 24, 2016 at 4:16 PM, Olivar Plays > wrote: > > Hello, > > > > I have a small question about the behaviour of Rack when it comes to > headers > > send by clients. > > Are these always prefixed with HTTP_ ? Or do I need to tell my clients > to > > explicitly send them as HTTP_ ? > > I think according to Rack SPEC, all headers sent from client should be > prefixed > with HTTP_, and if your client prefix HTTP_, then you'll end up seeing > HTTP_HTTP_ in your Rack application. > > > Example, I'm checking on every request in my Rails application whether > the > > HTTP_COMPANY header is present, and has the correct value. > > But I've been running into issues with detecting them. > > Right now I have the client app send the headers as COMPANY, and my > Rails > > app checks as HTTP_COMPANY. > > This is intended. > > > Is this the intended behaviour, or will this go wrong again when the > client > > suddenly submits the header as HTTP_COMPANY? > > e.g is Rack smart enough not to prefix HTTP_COMPANY with HTTTP_ again? > > As stated above, if your client is sending HTTP_COMPANY, then you'll need > to > access it via HTTP_HTTP_COMPANY in your Rack application. Rack should > not try to remove the prefix, otherwise HTTP_COMPANY and COMPANY > would be ambiguous. > > It's designed this way to mix HTTP headers into env unambiguously. > > > Kind regards, > > Arne > -- --- You received this message because you are subscribed to the Google Groups "Rack Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_1259_165408424.1477312103290 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Alright,

then we just need use some documentation a= nd properly communicate this.
At least I know where it stands now with R= ack and can deal with it appropriately.

Thank you for the informatio= n.

Kind regards,
Arne

Op maandag 24 oktober 2016 14:25:15 = UTC+2 schreef Lin Jen-Shin:
Hi,

On Mon, Oct 24, 2016 at 4:16 PM, Olivar Plays <arne.d...@gmail.com>= ; wrote:
> Hello,
>
> I have a small question about the behaviour of Rack when it comes = to headers
> send by clients.
> Are these always prefixed with HTTP_ ? Or do I need to tell my cli= ents to
> explicitly send them as HTTP_ ?

I think according to Rack SPEC, all headers sent from client should be = prefixed
with HTTP_, and if your client prefix HTTP_, then you'll end up see= ing
HTTP_HTTP_ in your Rack application.

> Example, I'm checking on every request in my Rails application= whether the
> HTTP_COMPANY header is present, and has the correct value.
> But I've been running into issues with detecting them.
> Right now I have the client app send the headers as COMPANY, and m= y Rails
> app checks as HTTP_COMPANY.

This is intended.

> Is this the intended behaviour, or will this go wrong again when t= he client
> suddenly submits the header as HTTP_COMPANY?
> e.g is Rack smart enough not to prefix HTTP_COMPANY with HTTTP_ ag= ain?

As stated above, if your client is sending HTTP_COMPANY, then you'l= l need to
access it via HTTP_HTTP_COMPANY in your Rack application. Rack should
not try to remove the prefix, otherwise HTTP_COMPANY and COMPANY
would be ambiguous.

It's designed this way to mix HTTP headers into env unambiguously.

> Kind regards,
> Arne

--

---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-dev= el+unsubscribe@googlegroups.com.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1259_165408424.1477312103290-- ------=_Part_1258_1671240967.1477312103289--