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

[BUG] HTTP Listener redriect does not respect proxy headers #4467

Open
MichaelLeeHobbs opened this issue Mar 4, 2021 · 0 comments
Open

[BUG] HTTP Listener redriect does not respect proxy headers #4467

MichaelLeeHobbs opened this issue Mar 4, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@MichaelLeeHobbs
Copy link

Describe the bug
A clear and concise description of what the bug is. Is this consistently reproducible?
First off this is actually two bugs. I think the second bug has already been reported.

  1. Mirth HTTP listener does not respect proxy headers on redirects ie x-forwarded-proto or x-forwarded-port
  2. HTTP listener adds a trailing slash which is should not.

To Reproduce
Setup steps (if required). Example:

  1. HTTP Listener Channel
  2. Local Port: 10004
  3. HTTP Listener with "Base Context Path: /order"
  1. Deploy channel
  2. Setup a proxy/loadbalancer
  3. wget -O- --no-check-certificate 'https://Mirth-Web-1111111111.us-east-1.elb.amazonaws.com/order'
  4. Mirth will redirect to: http:https://Mirth-Web-1111111111.us-east-1.elb.amazonaws.com/order/

HTTP Header as seen in Mirth

{
    x-forwarded-for=[18.111.111.1], 
    content-type=[application/json], 
    x-amzn-trace-id=[Root=1-6040fdcc-11111111134f74800], 
    content-length=[163], 
    host=[mirth-web-11111111.us-east-1.elb.amazonaws.com], 
    x-forwarded-proto=[https], 
    user-agent=[Wget/1.14 (linux-gnu)], 
    accept=[*/*], 
    x-forwarded-port=[443]
}

Expected behavior
A clear and concise description of what you expected to happen.

  1. Mirth should return a 404 rather than redirect
  2. If Mirth is going to redirect then it needs to respect proxy headers.
  3. If Mirth is going to redirect then it should use a 301 Moved Permanently response code and not a 302 Found. 302 is "This response code means that the URI of requested resource has been changed temporarily." which is not the case.
  4. Mirth should not add a trailing slash.

Actual behavior
A clear and concise description of what actually happens.
Mirth incorrect redirects and ignores proxy headers.

Screenshots
If applicable, add screenshots to help explain your problem.

[ec2-user@ip-172-31-16-5 ~]$ wget -S -O- --no-check-certificate --user username --password abc --header='Content-Type:application/json' --post-file=testdata.json 'https://Mirth-Web-111111.us-east-1.elb.amazonaws.com/order'
--2021-03-04 15:43:49-- https://mirth-web-11111.us-east-1.elb.amazonaws.com/order
Resolving mirth-web-1111111.us-east-1.elb.amazonaws.com (mirth-web-111111.us-east-1.elb.amazonaws.com)... 11.20.111.116, 34.111.11.106
Connecting to mirth-web-1111111.us-east-1.elb.amazonaws.com (mirth-web-111111.us-east-1.elb.amazonaws.com)|11.20.111.116|:443... connected.
WARNING: no certificate subject alternative name matches
requested host name ‘mirth-web-111111.us-east-1.elb.amazonaws.com’.
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Date: Thu, 04 Mar 2021 15:43:49 GMT
Content-Length: 0
Connection: keep-alive
Location: http:https://mirth-web-1111111.us-east-1.elb.amazonaws.com/order/
Server: Jetty(9.4.9.v20180320)
Location: http:https://mirth-web-111111.us-east-1.elb.amazonaws.com/order/ [following]

Environment (please complete the following information):

  • OS: AWS Linux 1 / ARM64 / Docker Container
  • OpenJDK 8
  • Connect Version 3.7.0

Workaround(s)
Are there one or more workarounds for this issue currently? None other than putting in the url with trailing slash.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant