-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Create Header Middleware #1236
Create Header Middleware #1236
Conversation
middlewares/headers.go
Outdated
} | ||
|
||
// Loop through Custom request headers | ||
if len(s.opt.CustomRequestHeaders) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the length check if you for-loop over its content (note that a nil map behaves like an empty map when reading).
Same for the custom response headers below.
@dtomcej Couldn't we reuse https://github.com/unrolled/secure instead of base our code on it ? |
@emilevauge I ran into a couple issues:
I have implemented a bit of code on line 717 of server.go, but would like some direction. I want to be able to have the headers configurable through the frontend objects. This would allow us to dynamically change them, and specify headers (both request and response) per route. If I can get part 2 working, I can then solve part 1 by wrapping it in an extension object. How would I go about with part 2? |
just curious, is this implemented already? |
Sorry, I have been super busy. Hoping to resume work on this in the next few days. |
After running |
That is good to hear @kaiyou. I am looking to get back in on this ticket this week. Just welcomed a son into our family last week, so its been a couple of busy weeks. I am going to be wrapping another module in this middleware to prevent code duplication. |
@dtomcej do you the time to update this PR before the upcoming feature freeze for the 1.3 release? |
Nice @dtomcej, if we could get this going in v1.3 that would be even better 👍 |
Due to SemaphoreCI, I close and reopen the PR. |
@dtomcej as soon as you are ready, we can move on this one :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job @dtomcej 👏 👏
LGTM (once glide.lock issue fixed)
Woot!!!
Le mar. 13 juin 2017 12:34, Ludovic Fernandez <notifications@github.com> a
écrit :
… Merged #1236 <#1236>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1236 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADJrq-0RZvgYiumHcY6i4K2eFITch6m2ks5sDmWzgaJpZM4MTJ40>
.
|
Whats the release schedule for these new merges? |
The 1.4 should be released in August. |
Will something like this work with docker labels? |
@oszi Thanks for your interest in Traefik 😃 This PR is closed. Please discuss this in :
|
Is the use of this documented somewhere? |
It was not directly obvious to me, but the documentation for those security headers can be found in the repository of the security middleware. |
Hi, is there a way to remove response headers that have been added by a backend? Similar to nginx proxy_hide_header |
Hi @hcaz, |
@mmatur Thanks for the reply! I know I can add custom headers, I am currently doing that, but for example if I add the Do you know if there are any plans to support removing of headers? |
@hcaz Sorry for the delay. It is plan for the next Træfik version and we will fix the duplicated headers too. |
@mmatur Awesome, thank you! :) |
This is a middleware based on github.com/unrolled/secure that allows us to control, and inject request and response headers.