Ticket #317 (closed enhancement: fixed)

Opened 3 months ago

Last modified 2 months ago

Server name in HTTP response

Reported by: thijs Owned by: nick
Priority: minor Milestone: 0.4
Component: Gateway Version: 0.3.1
Keywords: review Cc:

Description (last modified by thijs) (diff)

Would be nice to replace the default:

WSGIServer/0.1 Python 2.5.2

with:

PyAMF/0.3.1 Python 2.5.2

The attached patch updates the server name for all gateways.

Attachments

server-name-317.patch (9.1 kB) - added by thijs 3 months ago.
Updated patch for Server header
server-317.py (0.7 kB) - added by thijs 2 months ago.
client-317.py (315 bytes) - added by thijs 2 months ago.
consistent-printing-server-317.patch (1.8 kB) - added by thijs 2 months ago.

Change History

  Changed 3 months ago by thijs

  • priority changed from major to minor
  • keywords review added
  • status changed from new to assigned
  • owner changed from thijs to nick

Attached patch, assigning to Nick for review.

  Changed 3 months ago by thijs

Client debug output shows it works:

2008-06-20 17:38:18,215 INFO     Connecting to http://localhost:8000
2008-06-20 17:38:18,215 DEBUG    Service name: pygment
2008-06-20 17:38:18,216 INFO     Adding request: pygment.highlight('Python', 'print "Hello World"')
2008-06-20 17:38:18,216 DEBUG    Executing single request: /1
2008-06-20 17:38:18,218 DEBUG    Sending POST request to: 
2008-06-20 17:38:18,220 DEBUG    Waiting for the response...
2008-06-20 17:38:18,289 INFO     Got response status: 200
2008-06-20 17:38:18,290 DEBUG    Content-Type: application/x-amf
2008-06-20 17:38:18,290 DEBUG    Content-Length: 182
2008-06-20 17:38:18,290 DEBUG    Server: PyAMF/0.4.0 Python/2.5.2
2008-06-20 17:38:18,290 DEBUG    Read 182 bytes for the response
2008-06-20 17:38:18,291 DEBUG    Response: <Envelope amfVersion=0 clientType=0>
 (u'/1', <Response status=/onResult><MarkupVO id=1></Response>)
</Envelope>
2008-06-20 17:38:18,292 DEBUG    Removing request: /1

Changed 3 months ago by thijs

Updated patch for Server header

  Changed 3 months ago by thijs

  • description modified (diff)

  Changed 3 months ago by thijs

Created a branch that includes an update of the patch and more.

  Changed 2 months ago by nick

  • keywords merge added; review removed
  • owner changed from nick to thijs

Patch looks good. Please merge.

  Changed 2 months ago by thijs

  • status changed from assigned to closed
  • resolution set to fixed

Applied to the trunk in r1474.

  Changed 2 months ago by nick

  • status changed from closed to reopened
  • resolution fixed deleted

See #326

  Changed 2 months ago by nick

  • status changed from reopened to accepted
  • owner changed from thijs to nick

  Changed 2 months ago by nick

  • keywords review added; merge removed
  • status changed from accepted to assigned
  • owner changed from nick to thijs

Removed the platform import

follow-ups: ↓ 11 ↓ 12 ↓ 13   Changed 2 months ago by thijs

Few things while testing with Python 2.4:

  • This print in the tests should probably go:
    pyamf.tests.gateway.test_wsgi.WSGIServerTestCase.test_bad_request ... No handlers could be found for logger "pyamf.remoting.gateway.wsgi.WSGIGateway.0x140bd30"
    
  • This test is failing:
    ===============================================================================
    [ERROR]: adapters.test_django.TypeMapTestCase.test_NOT_PROVIDED
    
    Traceback (most recent call last):
      File "/usr/local/lib/python2.4/unittest.py", line 260, in run
        testMethod()
      File "/Volumes/collab1/Sites/software/pyamf/pyamf/branches/server-name-317-2/pyamf/tests/adapters/test_django.py", line 72, in test_NOT_PROVIDED
        from django.db.models import fields
      File "/Volumes/collab1/Sites/software/django/django/db/models/__init__.py", line 4, in ?
        from django.db import connection
    exceptions.ImportError: cannot import name connection
    -------------------------------------------------------------------------------
    

Will now test with (and add) a Python remoting client.

in reply to: ↑ 10   Changed 2 months ago by thijs

Replying to thijs:

Few things while testing with Python 2.4: - This print in the tests should probably go: {{{ pyamf.tests.gateway.test_wsgi.WSGIServerTestCase.test_bad_request ... No handlers could be found for logger "pyamf.remoting.gateway.wsgi.WSGIGateway.0x140bd30"

This one is also visible when running the unit tests with Python 2.5. The Django one isn't visible because Django is properly installed on 2.5

in reply to: ↑ 10   Changed 2 months ago by thijs

Replying to thijs:

Few things while testing with Python 2.4: - This print in the tests should probably go: {{{ pyamf.tests.gateway.test_wsgi.WSGIServerTestCase.test_bad_request ... No handlers could be found for logger "pyamf.remoting.gateway.wsgi.WSGIGateway.0x140bd30" }}}

This looks fixed after r1497.

in reply to: ↑ 10   Changed 2 months ago by thijs

Replying to thijs:

- This test is failing: =============================================================================== [ERROR]: adapters.test_django.TypeMapTestCase?.test_NOT_PROVIDED Traceback (most recent call last): File "/usr/local/lib/python2.4/unittest.py", line 260, in run testMethod() File "/Volumes/collab1/Sites/software/pyamf/pyamf/branches/server-name-317-2/pyamf/tests/adapters/test_django.py", line 72, in test_NOT_PROVIDED from django.db.models import fields File "/Volumes/collab1/Sites/software/django/django/db/models/init.py", line 4, in ? from django.db import connection exceptions.ImportError?: cannot import name connection -------------------------------------------------------------------------------

My local Python2.4 installation is probably broken, when I run import os; print os it gives a Bus Error. Testing it on a different Python2.4 doesnt throw the error so this is probably impossible to reproduce on other machines.

Changed 2 months ago by thijs

Changed 2 months ago by thijs

Changed 2 months ago by thijs

  Changed 2 months ago by thijs

  • owner changed from thijs to nick

Tested the branch with the attached server and client and looks good to me. Also attached a small patch that fixes some of the log statements and adds a log print for the 'Server' http header value.

  Changed 2 months ago by nick

  • status changed from assigned to closed
  • resolution set to fixed

Merged in r1499.

Note: See TracTickets for help on using tickets.