Skip to content

Add response headers doesn’t seem to work #269

@bgelens

Description

@bgelens

running core tools 2.7.1373 on macOS and published on Azure Function App

When trying to add response headers, they do not get appended correctly.

Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
      StatusCode = [HttpStatusCode]::NoContent
      ContentType = 'text/plain'
      Headers = @{
        foo = ‘bar’
      }
    })
$result.Headers

Key            Value
---            -----
Date           {Wed, 03 Jul 2019 15:24:03 GMT}
Server         {Kestrel}
Content-Type   {text/plain; charset=utf-8}
Content-Length {128}

$result.RawContent
HTTP/1.1 200 OK
Date: Wed, 03 Jul 2019 15:24:03 GMT
Server: Kestrel
Content-Type: text/plain; charset=utf-8
Content-Length: 128

{"method":"","query":{},"statusCode":"204","headers":{"foo":"bar","content-type":"text/plain"},"enableContentNegotiation":false}

Expecting $result.Headers[“foo”]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions