Modify SPDY headers (Middle Man)

56 views
Skip to first unread message

Vimala Tadepalli

unread,
Feb 6, 2015, 1:10:07 AM2/6/15
to spdy...@googlegroups.com
Hi,

Our firewall needs to modify the SPDY request made by the clients to youtube.com, so that they are redirected to youtube education.
For this we need to add a new HTTP header (X-youtube-Edu-Filter) with the value.

As soon as firewall gets the packet, i tried to implement the following
1. If its a SYN_STREAM packet, inflate it
2. Add the new header, update the length and no of variables
3. Deflate the SYN_STREAM and send it 

so initial request like this
"method:GET

:path:/

:version:HTTP/1.1

:host:www.youtube.com

:scheme:https

user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0

accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

accept-language:en-US,en;q=0.5

cookie:VISITOR_INFO1_LIVE=rYaTLyzTFXo; PREF=f5=30; YSC=s63CQVwF-ok"


has  been changed to 

":method:GET

:path:/

:version:HTTP/1.1

:host:www.youtube.com

:scheme:https

user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0

accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

accept-language:en-US,en;q=0.5

cookie:VISITOR_INFO1_LIVE=rYaTLyzTFXo; PREF=f5=30; YSC=s63CQVwF-ok

X-YouTube-Edu-Filter:0qzoTGqXlavINAsJGcxPjg"

When i send this request, youtube server is replying with a 400(Bad Request). Can someone let me know if i am missing anything?

Thanks
Vimala



Ryan Sleevi

unread,
Feb 6, 2015, 1:59:05 AM2/6/15
to spdy...@googlegroups.com

Per spec, the header name must all be lowercase.

http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2#TOC-HEADERS

http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1#TOC-2.6.10-Name-Value-Header-Block

https://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-8.1.2

--

---
You received this message because you are subscribed to the Google Groups "spdy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spdy-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages