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
pharrisee opened this issue May 16, 2018 · 4 comments
Assignees
Projects

Comments

@pharrisee
Copy link

@pharrisee 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

This comment has been minimized.

Copy link
Member

@jeevatkm jeevatkm commented May 16, 2018

@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 jeevatkm added the support label May 16, 2018
@jeevatkm

This comment has been minimized.

Copy link
Member

@jeevatkm jeevatkm commented May 18, 2018

@pharrisee Above information; does it fulfill your need?

@jeevatkm

This comment has been minimized.

Copy link
Member

@jeevatkm jeevatkm commented May 21, 2018

@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 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
… response headers
@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

This comment has been minimized.

Copy link
Member

@jeevatkm jeevatkm commented May 27, 2018

Its done 😄

@jeevatkm jeevatkm closed this May 27, 2018
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
Projects
aah Roadmap
  
Released to Audience
2 participants
You can’t perform that action at this time.