Skip to content

Headers not being sent #87

@ljmc2000

Description

@ljmc2000

Description
So this is a little odd. when I say
return response.Response(ctx, response_data="",headers{"Content-Type":"application/xml"})
the data is passed down through the stack and everything is hunky dorey. Everyone can see my outdated tastes in information interchange. However, if I try to set a header with no default value, such as Set-Cookie
return response.Response(ctx, response_data="",headers{"Set-Cookie": "Cookies=Delicious!"})
it gets lost in the mail and no browser will ever know of my passion for sweet chocolate chips :'(

Steps to reproduce the issue:

  1. create a default fn application with python runtime
  2. scroll down to the line headers{"Content-Type":"application/json"} and add a new header such as set cookie. the value doesn't matter. we're displaying absence here
  3. build and run curl -i against the endpoint. your new header will be absent

Describe the results you received:
headers that do not override another header vanish into the ether

Describe the results you expected:
headers are passed down through the layers and the browser shall know of my love of cookies.

Additional information you deem important (e.g. issue happens only occasionally):
overriding the fn-call-id header results in the fn-call-id header being sent twice. once with your override, once the original.

HTTP/1.1 200 OK
Content-Type: application/xml
Fn-Call-Id: 01DCMV614BNG8G00GZJ000001D
Fn-Call-Id: probably should not be overrideable
Date: Wed, 05 Jun 2019 22:12:07 GMT
Content-Length: 26

when running the fn server with the flag --log-level DEBUG your headers appear in the output:

resp="&{200 OK 200 HTTP/1.1 1 1 map[Content-Type:[application/xml] Fn-Call-Id:[probably should not be overrideable] Set-Cookie:[Cookies=Delicious] Age:[12] Fn-Fdk-Version:[0.1.5] Content-Length:[26] Connection:[keep-alive] Keep-Alive:[75]] 0xc420150e00 26 [] false false map[] 0xc420277100 <nil>}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions