Project

General

Profile

Actions

Bug #2808

closed

mod_uploadprogress fails when using parameters

Added by dbixler almost 7 years ago. Updated almost 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_uploadprogress
Target version:
ASK QUESTIONS IN Forums:

Description

Using the parameterized form (/progress?X-Progress-ID=XXXXXX.... doesn't work because it takes the entire parameter ("X-Progress-ID=XXXXXX....") and applies the test for the ID (must be exactly 32 characters, must be hex digits). It will never pas these tests.


Files

Actions #1

Updated by gstrauss almost 7 years ago

Please try the attached patch.

Actions #2

Updated by dbixler almost 7 years ago

I have tried the patch. I am no longer getting the error I was. The upload is happening, but I cannot get the status. At this point, I'm not sure whether the problem is mine or yours. If you could give me a little guidance, I'll keep trying.

My config file contains:

upload-progress.progress-url = "/uploadprogress"
upload-progress.debug = "enable"

The upload url is:

<form action="/migration/upload?X-Progress-ID=12345678901234567890123456789012" name="form" method="post" enctype="multipart/form-data">

although the parameter is gone when it gets logged (not surprising).

The status url is logged as:

10.100.1.126 hyperion.intradyn.com - [08/May/2017:21:57:15 +0000] "GET /uploadprogress?X-Progress-ID=12345678901234567890123456789012 HTTP/1.1" 302 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"

and the I'm being told it's an invalid url (again, not surprising, as I haven't defined that url).

My understanding is that the httpd server itself should answer the request, and my code should never know it happened. The upload is completing successfully, but I cannot get status. Please let me know if you see an error in my setup.

Actions #3

Updated by dbixler almost 7 years ago

Oh, and my defined modules are:

server.modules = (
"mod_uploadprogress",
"mod_expire",
"mod_rewrite",
"mod_alias",
"mod_access",
"mod_fastcgi",
"mod_accesslog",
"mod_magnet"
)

Actions #4

Updated by gstrauss almost 7 years ago

You haven't provided your entire config and the mistake is probably there. lighttpd -f /etc/lighttpd/lighttpd.conf -p

10.100.1.126 hyperion.intradyn.com - [08/May/2017:21:57:15 +0000] "GET /uploadprogress?X-Progress-ID=12345678901234567890123456789012 HTTP/1.1" 302 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"

Why is lighttpd returning a 302 for that page? Do you have mod_expire add caching headers to all requests? (Don't do that.)

What headers does your browser send with the GET request? Either use the tools available in your browser, or set debug.log-request-header = "enable" in lighttpd.conf and look at the error.log after making the GET request.

Actions #5

Updated by dbixler almost 7 years ago

Configuration attached.

In our product, any URL not recognized returns a redirect to a default page with an error set. My understanding is that the back-end should never see this request if it is recognized as a upload status request.

What is the meaning of the upload-progress.remove-timeout setting? The documentation doesn't say.

Request headers:

2017-05-09 18:24:43: (request.c.436) fd: 9 request-len: 866
POST /migration/upload?X-Progress-ID=12345678901234567890123456789012 HTTP/1.1
Host: hyperion.intradyn.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://hyperion.intradyn.com/migration/upload/
Cookie: sessionid=ihJ0jYBCD9i0yik8hbTxcebDrRjqJIrrLZDnXubK6Xf5F9cAwCT6xFrsZ8z59mt4; django_language=en; __hstc=138033519.1e88898030ca80a3a89bf7d9b2d05285. 1493406879758.1493406879758.1493406879758.1; __hssrc=1; hubspotutk=1e88898030ca80a3a89bf7d9b2d05285; user_segment=Prospect
Connection: keep-alive
DNT: 1
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data; boundary=---------------------------10311050251881272840283255157
Content-Length: 2426735094

2017-05-09 18:25:36: (request.c.436) fd: 12 request-len: 676
GET /uploadprogress?X-Progress-ID=12345678901234567890123456789012 HTTP/1.1
Host: hyperion.intradyn.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: sessionid=ihJ0jYBCD9i0yik8hbTxcebDrRjqJIrrLZDnXubK6Xf5F9cAwCT6xFrsZ8z59mt4; django_language=en; __hstc=138033519.1e88898030ca80a3a89bf7d9b2d05285.1493406879758.1493406879758.1493406879758.1; __hssrc=1; hubspotutk=1e88898030ca80a3a89bf7d9b2d05285; user_segment=Prospect
Connection: keep-alive
DNT: 1
Upgrade-Insecure-Requests: 1

Actions #6

Updated by gstrauss almost 7 years ago

In our product, any URL not recognized returns a redirect to a default page with an error set. My understanding is that the back-end should never see this request if it is recognized as a upload status request.

It would appear that your product is responding to GET /uploadprogress?X-Progress-ID=12345678901234567890123456789012 You should verify that since mod_progress should not be responding with a 302 redirect. Look in the lighttpd access.log (mod_accesslog is enabled) or set debug.log-request-header = "enable" in lighttpd.conf and look at the error.log after making the GET request.

If the request is reaching lighttpd, then this rule in your config might intercept the request before mod_uploadprogress gets a chance

    url.rewrite-once               = (
        "^/media/(.*)"      => "/media/$1",
        "^/vault/tmp/(.*)$" => "/vault/tmp/$1",
        "^(/down/.*)$"      => "/down.fcgi$1",
        "^(/.*)$"           => "/cv4.fcgi$1",
    )

Is the request being internally redirected to /cv4.fcgi?

Actions #7

Updated by dbixler almost 7 years ago

That's it. By adding a new rewrite rule:

"^/uploadprogress(.*)$" => "/uploadprogress$1",

I can now get the progress information.

Thank you very much for your help.

Actions #8

Updated by gstrauss almost 7 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom