Permalink
Browse files

spdy/v3 passes :path; spdy/v2 passes absolute 'url' header

  • Loading branch information...
1 parent 575e0ed commit 0b88c940893542d0af893c6eac3ed37de1ce10d9 @igrigorik committed Jul 19, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/server.js
View
@@ -3,6 +3,7 @@ var spdy = require('spdy'),
path = require('path'),
util = require('util'),
net = require('net'),
+ url = require('url'),
fs = require('fs');
var SPDYProxy = function(options) {
@@ -29,12 +30,13 @@ var SPDYProxy = function(options) {
}
function handlePlain(req, res) {
+ var path = req.headers.path || url.parse(req.url).path;
var requestOptions = {
host: req.headers.host,
port: req.headers.host.split(':')[1] || 80,
- path: req.url,
+ path: path,
method: req.method,
- headers: req.headers // TODO: remove, host, method, etc?
+ headers: req.headers
};
var rreq = http.request(requestOptions, function(rres) {

0 comments on commit 0b88c94

Please sign in to comment.