Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to delete headers on an app-wide basis #181

Closed
2 tasks done
pharrisee opened this issue May 16, 2018 · 4 comments
Closed
2 tasks done

Add a way to delete headers on an app-wide basis #181

pharrisee opened this issue May 16, 2018 · 4 comments
Assignees
Labels
Projects

Comments

@pharrisee
Copy link

pharrisee commented May 16, 2018

After reading this:

https://www.fastly.com/blog/headers-we-dont-want

It struck me that there doesn't seem to be a way to remove headers on an app-wide basis.

What would be the best way to achieve this? OnPreReply hook?

Could there be a config option for custom header inclusion and exclusion?


  • Implementation
  • Documentation
@jeevatkm jeevatkm self-assigned this May 16, 2018
@jeevatkm
Copy link
Member

@pharrisee Thanks for sharing. Yeah it is informative article.

You have guess it correctly, best spot is OnPreReply.


My thoughts; discussed headers in the article mostly applicable to proxy server, cache server, etc For e.g. CDN's.

As an application; header originates here. aah has OOTB configs -

@jeevatkm
Copy link
Member

@pharrisee Above information; does it fulfill your need?

@jeevatkm
Copy link
Member

@pharrisee I have thought about your idea. A way to manipulate the headers for each request at application level.

Having more flexibility and control of reply in aah framework is important. So I'm planning to add following enhancement in HTTP Engine-

  • OnHeaderReply - Called for each reply from aah server. At this point all the headers from aah have been written on the response writer except Header Status.
aah.AppHTTPEngine().OnHeaderReply(HandleHeader)

func HandleHeader(e *aah.Event) {
	hdr := e.Data.(http.Header)

	// Header instance is direct reference to http.ResponseWritter
	// Change reflects immediately :)
	//
	// logic goes here
}

Converting this issue as Enhancement.

@jeevatkm jeevatkm added enhancement server aah Go Server and removed support labels May 21, 2018
@jeevatkm jeevatkm added this to v0.11.0 - Iteration in aah Roadmap via automation May 21, 2018
@jeevatkm jeevatkm added this to the v0.11.0 Milestone milestone May 21, 2018
jeevatkm added a commit that referenced this issue May 25, 2018
@jeevatkm jeevatkm moved this from v0.11.0 - Iteration to v0.11.0 - In Progress in aah Roadmap May 25, 2018
jeevatkm added a commit to go-aah/docs that referenced this issue May 27, 2018
@jeevatkm
Copy link
Member

Its done 😄

aah Roadmap automation moved this from v0.11.0 - In Progress to v0.11.0 - Completed May 27, 2018
@jeevatkm jeevatkm moved this from v0.11.0 - Completed to Released to Audience in aah Roadmap Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
aah Roadmap
  
Released to Audience
Development

No branches or pull requests

2 participants