Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit 4748f40

Browse files
committed
PR http-party#1125: rewrite HTTP 303
1 parent a3fe02d commit 4748f40

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ proxyServer.listen(8015);
345345
* **changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL
346346
* **preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key
347347
* **auth**: Basic authentication i.e. 'user:password' to compute an Authorization header.
348-
* **hostRewrite**: rewrites the location hostname on (201/301/302/307/308) redirects.
349-
* **autoRewrite**: rewrites the location host/port on (201/301/302/307/308) redirects based on requested host/port. Default: false.
350-
* **protocolRewrite**: rewrites the location protocol on (201/301/302/307/308) redirects to 'http' or 'https'. Default: null.
348+
* **hostRewrite**: rewrites the location hostname on (201/301/302/303/307/308) redirects.
349+
* **autoRewrite**: rewrites the location host/port on (201/301/302/303/307/308) redirects based on requested host/port. Default: false.
350+
* **protocolRewrite**: rewrites the location protocol on (201/301/302/303/307/308) redirects to 'http' or 'https'. Default: null.
351351
* **cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values:
352352
* `false` (default): disable cookie rewriting
353353
* String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`.

lib/http-proxy/passes/web-outgoing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var url = require('url'),
22
common = require('../common');
33

44

5-
var redirectRegex = /^201|30(1|2|7|8)$/;
5+
var redirectRegex = /^201|30(1|2|3|7|8)$/;
66

77
/*!
88
* Array of passes.

test/lib-http-proxy-passes-web-outgoing-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('lib/http-proxy/passes/web-outgoing.js', function () {
2424
beforeEach(function() {
2525
this.options.hostRewrite = 'ext-manual.com';
2626
});
27-
[201, 301, 302, 307, 308].forEach(function(code) {
27+
[201, 301, 302, 303, 307, 308].forEach(function(code) {
2828
it('on ' + code, function() {
2929
this.proxyRes.statusCode = code;
3030
httpProxy.setRedirectHostRewrite(this.req, {}, this.proxyRes, this.options);
@@ -69,7 +69,7 @@ describe('lib/http-proxy/passes/web-outgoing.js', function () {
6969
beforeEach(function() {
7070
this.options.autoRewrite = true;
7171
});
72-
[201, 301, 302, 307, 308].forEach(function(code) {
72+
[201, 301, 302, 303, 307, 308].forEach(function(code) {
7373
it('on ' + code, function() {
7474
this.proxyRes.statusCode = code;
7575
httpProxy.setRedirectHostRewrite(this.req, {}, this.proxyRes, this.options);
@@ -108,7 +108,7 @@ describe('lib/http-proxy/passes/web-outgoing.js', function () {
108108
beforeEach(function() {
109109
this.options.protocolRewrite = 'https';
110110
});
111-
[201, 301, 302, 307, 308].forEach(function(code) {
111+
[201, 301, 302, 303, 307, 308].forEach(function(code) {
112112
it('on ' + code, function() {
113113
this.proxyRes.statusCode = code;
114114
httpProxy.setRedirectHostRewrite(this.req, {}, this.proxyRes, this.options);

0 commit comments

Comments
 (0)