Skip to content
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

JSON Responses are corrupt if served via proxy #115

Open
klopfdreh opened this issue Aug 25, 2015 · 3 comments
Open

JSON Responses are corrupt if served via proxy #115

klopfdreh opened this issue Aug 25, 2015 · 3 comments

Comments

@klopfdreh
Copy link

Hi,

I'm currenty encountering the problem, that via proxy some JSON responses get corrupted. If I access the proxied server directly the response is valid and everything is working.

Response-Header of proxy (port 8000):

Cache-Control no-cache,must-revalidate
Connection close
Content-Encoding UTF-8
Content-Length 14
Content-Type application/json
Date Tue, 25 Aug 2015 08:05:51 GMT
Server WildFly/8
x-powered-by Undertow/1

Response-Body:

e
{"id":"1251

Response-Header of Wildfly via direct access (port 8080)

Cache-Control no-cache,must-revalidate
Connection keep-alive
Content-Encoding UTF-8
Content-Length 14
Content-Type application/json
Date Tue, 25 Aug 2015 08:16:44 GMT
Server WildFly/8
x-powered-by Undertow/1

Response-Body

{"id":"12522"}

(id may differ, because the actual one is returned from server during the creation process)

Environment:

  "devDependencies": {
    "autoprefixer-core": "^5.2.0",
    "chai": "^3.0.0",
    "csswring": "^3.0.5",
    "grunt": "^0.4.5",
    "serve-static": "^1.10.0", 
    "serve-index": "^1.7.2",
    "eventemitter3": "^1.1.1",
    "livereload-js": "^2.2.2",
    "connect-static": "^1.5.1",
    "connect": "^3.4.0",
    "grunt-bower-install": "^1.6.0",
    "grunt-concurrent": "^1.0.0",
    "grunt-connect-proxy": "^0.2.0",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-compass": "^1.0.3",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-connect": "^0.11.2",
    "grunt-contrib-copy": "^0.8.0",
    "grunt-contrib-cssmin": "^0.12.3",
    "grunt-contrib-htmlmin": "^0.4.0",
    "grunt-contrib-jshint": "^0.11.2",
    "grunt-contrib-sass": "^0.9.2",
    "grunt-contrib-uglify": "^0.9.1",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-file-append": "0.0.6",
    "grunt-grunt": "^0.2.3",
    "grunt-karma": "^0.11.0",
    "grunt-manifest": "^0.4.0",
    "grunt-mocha-test": "^0.12.7",
    "grunt-newer": "^1.1.0",
    "grunt-ng-annotate": "^1.0.1",
    "grunt-ng-constant": "^1.1.0",
    "grunt-postcss": "^0.4.0",
    "grunt-processhtml": "^0.3.7",
    "grunt-proxy": "^0.0.3",
    "grunt-svgstore": "^0.5.0",
    "grunt-text-replace": "^0.4.0",
    "grunt-tslint": "^2.2.0-beta",
    "grunt-typescript": "^0.6.2",
    "grunt-usemin": "^3.0.0",
    "jshint-stylish": "^2.0.0",
    "karma": "^0.12.36",
    "karma-chrome-launcher": "^0.1.12",
    "karma-coverage": "^0.3.1",
    "karma-mocha": "^0.1.10",
    "karma-phantomjs-launcher": "^0.2.0",
    "karma-sinon-chai": "^0.3.0",
    "load-grunt-tasks": "^3.2.0",
    "lodash": "^3.9.3",
    "ripple-emulator": "^0.9.29",
    "sinon": "^1.14.1",
    "time-grunt": "^1.2.1",
    "tslint": "^2.2.0-beta",
    "typescript": "~1.4.1"
  }

It looks like the response was shifted somehow and the result was started at a position which is not valid.

I also tried to fix the issue as mentioned in this ticket #73 but without success.

In livereload I already using the new modules serve-static / serve-index to push the files / directories.

Thank you in advance!

Edit forgot to mention the proxy settings:

    {
        context: [ <some context paths containing the rest resources>],
        host: 'localhost',
        port: 8080,
        https: false,
        changeOrigin: false,
        xforward: false
    }
@klopfdreh
Copy link
Author

Okay I got it! I only provided the header in this ticket which I thought to be relevant for this issue, but there were others which caused the problem:

They look like:

x-webmethods-cache-control:[no-cache,must-revalidate]

Maybe the brackets are causing the issue?!

@cowwoc
Copy link

cowwoc commented Nov 24, 2016

@klopfdreh I am willing to bet this is caused by #73 (comment)

@klopfdreh
Copy link
Author

Hi @cowwoc - it seems so yes. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants