From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7386 invoked from network); 16 Dec 2020 19:55:32 -0000 Received: from ewsd.inri.net (107.191.116.128) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2020 19:55:32 -0000 Received: from mail-qt1-f176.google.com ([209.85.160.176]) by ewsd; Wed Dec 16 14:54:50 -0500 2020 Received: by mail-qt1-f176.google.com with SMTP id j26so18221973qtq.8 for <9front@9front.org>; Wed, 16 Dec 2020 11:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:to:subject:date:in-reply-to:mime-version :content-transfer-encoding; bh=RRYx/LCRVIVCQg4O595E7U6o1uVDitHSHEuvnlUB8Xw=; b=MVmp3HB1446mTJuf2yucAOBygVcUkqCgnKEu+tNbqClXJAOzr66L/NHCuYWgl+DLU0 62Q6eubpDiqJ/zhUxPvngUalA1mAcX/aaK/b/U8+jrqNjM5ViXqgzzJO/iANIzZow/01 L7LGnlsYLWZ8+/grpD9qC9GBAaDkuH3mU+jEoWPoEAu8cpM4sKe3NhwR1UDt1EzJj+fu cfvUjd5L9aEqijGEOxMvitWQcy4SZamnwXyquQdtmSZzgrY8vzn0xm5tiXFTyMejNkfG 2eWY+p+tYbhxPvnzadmOCzz441CYd/eLAcgKmPrmzBt5LN/HpCRRbrPZvmDU6iRDBOcj 3qAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:to:subject:date:in-reply-to :mime-version:content-transfer-encoding; bh=RRYx/LCRVIVCQg4O595E7U6o1uVDitHSHEuvnlUB8Xw=; b=L/pDRmr75cbgJv9TTabFXObDh/0JgzhGx0OGVJ7WV2Rz4luKMzjqTsfUno/ZI2aCaM JcGmwv03qF4iO1FqcjbfwebhlZcY5mzR6dA1fg3EhFIsur9GF5X8BuoiO6bzcWqRBzHN k0vi8Cteve2obT0RqNGN3+oj7cHGgiXTvjPJyw01Lt601E4c+WbP6jzGWjiZulzgoZ5f lqZK+Q0LCAiwDCmYV8e+wpgMr38Ql25iQ7edbJA2HMQnqWTZhnUxnonFpyJ8x/vao8Bi vps7yBdrUjeItmSRCHCAKGkme553A6zH+hhH8MFaYB3Qa24cS7G3l3roq3YiEOsa2nsU fzTw== X-Gm-Message-State: AOAM530ePqWh2VaXbDFdAcyrf0FAJHsVaIXhSDs6tfusEj/1eDdWotLu vGFawiaGjJuBrwicVmcT8ZIos/Ac25I= X-Google-Smtp-Source: ABdhPJw360MHrmb7lr9PL4fl20axdaZhfeE0Z4r7UU6cFf0UMBwpHmJqeVlOafLFOwpiK8JbbzV/VA== X-Received: by 2002:ac8:6c4a:: with SMTP id z10mr42963209qtu.183.1608148481694; Wed, 16 Dec 2020 11:54:41 -0800 (PST) Return-Path: Received: from junko.shrine (164.163.113.230.yesconnect.net.br. [164.163.113.230]) by smtp.gmail.com with ESMTPSA id z10sm1709188qtm.54.2020.12.16.11.54.40 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Dec 2020 11:54:41 -0800 (PST) From: estevan.cps@gmail.com X-Google-Original-From: tevo@gmail.com Message-ID: <6BAA5569E9ABF35DB2A737153B02C8A6@gmail.com> To: 9front@9front.org Date: Wed, 16 Dec 2020 19:54:38 +0000 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: progressive distributed configuration-aware event rich-client proxy-oriented control Subject: Re: [9front] [PATCH] Update hpost to use -r header like hget Reply-To: 9front@9front.org Precedence: bulk Hello, > I had issues with just expanding the headers using -r^headers. It > generates an hget command like (just an echo before line 98): > > hget -rX-Foo: Lol -rAuthorization: Bearer Token -r Content-Type: > multipart/form-data; boundary=HJBOUNDARY -b https://httpbin.org -P /post The output from that echo is likely misleading, "-rX-Foo: Lol", for example, has a space in it but is passed as a single argument to the program; you'd probably be better off testing that sort of stuff with something that shows arguments separately (unless you're aware of the implications of echoing it and don't care); the following could be helpful: #!/bin/rc for(i in `{seq 0 $#*}) echo $i: $*($i) > where a valid hget command would be: > hget -r 'X-Foo: Lol' -r 'Authorization: Bearer Token' -r 'Content-Type: > multipart/form-data; boundary=HJBOUNDARY' -b https://httpbin.org -P /post That's rather inconsistent with, i.e. how arg(2) would parse flags though; (unless I'm overlooking something probably really simple) it probably should handle the argument to the flag whether it is in the same "argv-argument" or not. That can probably be achieved by rewriting hget (and hpost, for that matter) to use something like getflags(8), but that would probably require a patch to getflags to handle "variadic flag arguments" (so multiple -r flags would add the contents to a list instead of overwriting them in turn like it would do now). Could probably sketch something a little bit later (maybe someone has something to add as well?). Hope that's helpful, -- Tevo