Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Trivial fix setting req.originalUrl to support connect>2.3.5 #38

Merged
merged 1 commit into from

4 participants

@framp

I've built @psunkara test suite (here: https://github.com/framp/connect-union) for connect and union (following what he did with the previous version) and fixed the trivial bug of originalUrl.

It looks like both req.url and req.originalUrl are being used.

There are still 7 errors according to the test, but I'm not sure if they're bugs specific to union or simply differences between flatiron and connect (as I'm not familiar with the codebase)

1) connect.cookieSession() should reset on invalid parse:
TypeError: Cannot read property 'should' of undefined
(Here the test expect a variable set to null instead of undefined)
2) connect.session() req.session .cookie when the pathname does not match cookie.path should not set-cookie:
TypeError: Cannot set property 'foo' of undefined
3) connect.static() when a trailing backslash is given should 500:
Error: Parse Error
4) connect.static() when mounted should redirect relative to the originalUrl:
TypeError: Property '0' of object /static is not a function
5) connect.static() on ENAMETOOLONG should next():
Error: timeout of 600ms exceeded
6) connect.static() on ENAMETOOLONG should next():
Error: timeout of 600ms exceeded

@travisbot

This pull request passes (merged 94da26a into c7f7ac9).

@pksunkara pksunkara merged commit f8d6fec into flatiron:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 26, 2012
  1. @framp
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/http-stream.js
  2. +1 −1  lib/request-stream.js
View
2  lib/http-stream.js
@@ -38,7 +38,7 @@ HttpStream.prototype.pipeState = function (source) {
this.method = source.method;
if (source.url) {
- this.url = source.url;
+ this.url = this.originalUrl = source.url;
}
if (source.query) {
View
2  lib/request-stream.js
@@ -30,7 +30,7 @@ util.inherits(RequestStream, HttpStream);
// Remark: Is there anything else we wish to pipe?
//
RequestStream.prototype.pipeRequest = function (source) {
- this.url = source.url;
+ this.url = this.originalUrl = source.url;
this.method = source.method;
this.httpVersion = source.httpVersion;
this.setEncoding = source.setEncoding;
Something went wrong with that request. Please try again.