Truncation of POST data on semicolon during param processing (unencoding?) #543

Closed
leskiger opened this Issue Apr 18, 2013 · 2 comments

Comments

Projects
None yet
3 participants

Hi all,
I'm experiencing an issue where rack (under the hood of a Sinatra app)appears to be truncating POST data on semicolons during the unencoding process. The data looks as expected in the NGINX logs, rack.request.form_vars, and rack.request.form_hash, but is truncated when accessed through request.params.

Rack version: 1.4.1

I've included data from each step below, as well a dump of the whole request object and the Gemfile.lock for the project.

Any thoughts/leads/suggestions would be greatly appreciated.

Bonus question: the encoding of the data in the NGINX log is not what I'm used to. We usually receive posts with a more standard-looking url encoding, e.g. "data=%3c%3fxml%20version%3d%221.0%22%20" rather than "data=" This data is being encoded by the cURL C Library (I believe) on an embeded device. If there are no semicolons in the data, it is encoded with all the special chars %ed, if there is a semicolon in the data it is encoded as per the second (failing/truncating) example. Embeded guys tell me there is no difference in what they're doing other than sending the semicolon or stripping it out, so the cURL lib must be making some kind of auto change. Anyone have experience there?

Thanks so much!
Les

NGINX access log
[18/Apr/2013:15:58:15 +0000] "POST /gateway HTTP/1.1" 200 3 "-" "username=XXXXXX&password=XXXXXX&data=\x0A\x0D\x0A\x0D<datacom xmlns=\x22http://www.pvpowered.com\x22\x0A\x0D\x09xmlns:xsi=\x22http://www.w3.org/2001/XMLSchema-instance\x22\x0A\x0D\x09xsi:schemaLocation=\x22http://www.pvpowered.com file:./datacom.xsd\x22>\x0A\x0D\x0A\x0D\x09<inverter_model>3159500</inverter_model>\x0A\x0D\x09<inverter_serial>551122</inverter_serial>\x0A\x0D\x09<text_serial>551122</text_serial>\x0A\x0D\x09<nx_mb_serial>M/N 3159500-0001 AA; S/N 551122; F/R AA</nx_mb_serial>\x0A\x0D\x09<firmware_version>10.0</firmware_version>\x0A\x0D\x09<micro_rev>23</micro_rev>\x0A\x0D\x09<pvm_status>00</pvm_status>\x0A\x0D\x09<modbus_addr>175</modbus_addr>\x0A\x0D\x097/8/08\x0A\x0D\x097200128B.12 \x0A\x0D\x097450015J.02 \x0A\x0D\x090xf27c\x0A\x0D\x091\x0A\x0D\x090\x0A\x0D\x09<pvm_hardware>AEI PVM2025 i.MX28</pvm_hardware>\x0A\x0D\x0A\x0D\x0A\x0D\x0A\x0D\x09<timestamp_on>2013-04-18 15:58:10</timestamp_on>\x0A\x0D\x09<ts_valid>1</ts_valid>\x0A\x0D\x09<event_type>9</event_type>\x0A\x0D\x091538\x0A\x0D\x09\x0A\x0D\x09\x09553680896\x0A\x0D\x09\x090\x0A\x0D\x09\x093584\x0A\x0D\x09\x090\x0A\x0D\x09\x0A\x0D\x09<ac_power>-0.0</ac_power>\x0A\x0D\x0955.08\x0A\x0D\x09<ac_kVAr>-0.0</ac_kVAr>\x0A\x0D\x09<d_axis_line_v>0</d_axis_line_v>\x0A\x0D\x09<d_axis_line_i>-0.5</d_axis_line_i>\x0A\x0D\x09<q_axis_line_i>0.5</q_axis_line_i>\x0A\x0D\x09<dc_volts>0</dc_volts>\x0A\x0D\x09<dc_volts2>0</dc_volts2>\x0A\x0D\x09<dc_current>-0.7</dc_current>\x0A\x0D\x09<ac_current>1.0</ac_current>\x0A\x0D\x09<common_mode_volts>-5.4</common_mode_volts>\x0A\x0D\x0919.3\x0A\x0D\x09<temp_coolant>48.2</temp_coolant>\x0A\x0D\x09<temp_reactor>96.7</temp_reactor>\x0A\x0D\x09<temp_cabinet>3.9</temp_cabinet>\x0A\x0D\x09<ground_i>0.70</ground_i>\x0A\x0D\x090\x0A\x0D\x09<neg_seq_v_mag>0.0</neg_seq_v_mag>\x0A\x0D\x09<reactive_pwr>-0.0</reactive_pwr>\x0A\x0D\x09<pwr_ac_limit>0</pwr_ac_limit>\x0A\x0D\x09<powerfactor_sp>1.000</powerfactor_sp>\x0A\x0D\x09<temp_ambient_pvm>28</temp_ambient_pvm>\x0A\x0D\x09<total_kwh>0</total_kwh>\x0A\x0D\x09<ac_volts>-0</ac_volts>\x0A\x0D\x09<ac_volts_b>0</ac_volts_b>\x0A\x0D\x09<ac_volts_c>0</ac_volts_c>\x0A\x0D\x09<power_dc>0</power_dc>\x0A\x0D\x0A\x0D\x0A\x0D\x0A\x0D" "-"

rack.request.form_vars
"rack.request.form_vars"=>"username=XXXXXX&password=XXXXXX&data=\n\r\n\r<datacom xmlns="http://www.pvpowered.com\"\n\r\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\r\txsi:schemaLocation=\"http://www.pvpowered.com file:./datacom.xsd">\n\r\n\r\t<inverter_model>3159500</inverter_model>\n\r\t<inverter_serial>551122</inverter_serial>\n\r\t<text_serial>551122</text_serial>\n\r\t<nx_mb_serial>M/N 3159500-0001 AA; S/N 551122; F/R AA</nx_mb_serial>\n\r\t<firmware_version>10.0</firmware_version>\n\r\t<micro_rev>23</micro_rev>\n\r\t<pvm_status>00</pvm_status>\n\r\t<modbus_addr>175</modbus_addr>\n\r\t7/8/08\n\r\t7200128B.12 \n\r\t7450015J.02 \n\r\t0xf27c\n\r\t1\n\r\t0\n\r\t<pvm_hardware>AEI PVM2025 i.MX28</pvm_hardware>\n\r\n\r<message timestamp="0" poll_count="1" poll_interval="60" type="event" digi_system_clock="1366300694" mmc_free_space="3632427008">\n\r<event sequence_id="0">\n\r\t<timestamp_on>2013-04-18 15:58:10</timestamp_on>\n\r\t<ts_valid>1</ts_valid>\n\r\t<event_type>9</event_type>\n\r\t1538\n\r\t\n\r\t\t553680896\n\r\t\t0\n\r\t\t3584\n\r\t\t0\n\r\t\n\r\t<ac_power>-0.0</ac_power>\n\r\t55.08\n\r\t<ac_kVAr>-0.0</ac_kVAr>\n\r\t<d_axis_line_v>0</d_axis_line_v>\n\r\t<d_axis_line_i>-0.5</d_axis_line_i>\n\r\t<q_axis_line_i>0.5</q_axis_line_i>\n\r\t<dc_volts>0</dc_volts>\n\r\t<dc_volts2>0</dc_volts2>\n\r\t<dc_current>-0.7</dc_current>\n\r\t<ac_current>1.0</ac_current>\n\r\t<common_mode_volts>-5.4</common_mode_volts>\n\r\t19.3\n\r\t<temp_coolant>48.2</temp_coolant>\n\r\t<temp_reactor>96.7</temp_reactor>\n\r\t<temp_cabinet>3.9</temp_cabinet>\n\r\t<ground_i>0.70</ground_i>\n\r\t0\n\r\t<neg_seq_v_mag>0.0</neg_seq_v_mag>\n\r\t<reactive_pwr>-0.0</reactive_pwr>\n\r\t<pwr_ac_limit>0</pwr_ac_limit>\n\r\t<powerfactor_sp>1.000</powerfactor_sp>\n\r\t<temp_ambient_pvm>28</temp_ambient_pvm>\n\r\t<total_kwh>0</total_kwh>\n\r\t<ac_volts>-0</ac_volts>\n\r\t<ac_volts_b>0</ac_volts_b>\n\r\t<ac_volts_c>0</ac_volts_c>\n\r\t<power_dc>0</power_dc>\n\r\n\r\n\r\n\r"

rack.request.form_hash
"rack.request.form_hash"=>{"username"=>"XXXXXX", "password"=>"XXXXXX", "data"=>"\n\r\n\r<datacom xmlns="http://www.pvpowered.com\"\n\r\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\r\txsi:schemaLocation=\"http://www.pvpowered.com file:./datacom.xsd">\n\r\n\r\t<inverter_model>3159500</inverter_model>\n\r\t<inverter_serial>551122</inverter_serial>\n\r\t<text_serial>551122</text_serial>\n\r\t<nx_mb_serial>M/N 3159500-0001 AA", "S/N 551122"=>nil, "F/R AA</nx_mb_serial>\n\r\t<firmware_version>10.0</firmware_version>\n\r\t<micro_rev>23</micro_rev>\n\r\t<pvm_status>00</pvm_status>\n\r\t<modbus_addr>175</modbus_addr>\n\r\t7/8/08\n\r\t7200128B.12 \n\r\t7450015J.02 \n\r\t0xf27c\n\r\t1\n\r\t0\n\r\t<pvm_hardware>AEI PVM2025 i.MX28</pvm_hardware>\n\r\n\r<message timestamp"=>""0" poll_count="1" poll_interval="60" type="event" digi_system_clock="1366300694" mmc_free_space="3632427008">\n\r<event sequence_id="0">\n\r\t<timestamp_on>2013-04-18 15:58:10</timestamp_on>\n\r\t<ts_valid>1</ts_valid>\n\r\t<event_type>9</event_type>\n\r\t1538\n\r\t\n\r\t\t553680896\n\r\t\t0\n\r\t\t3584\n\r\t\t0\n\r\t\n\r\t<ac_power>-0.0</ac_power>\n\r\t55.08\n\r\t<ac_kVAr>-0.0</ac_kVAr>\n\r\t<d_axis_line_v>0</d_axis_line_v>\n\r\t<d_axis_line_i>-0.5</d_axis_line_i>\n\r\t<q_axis_line_i>0.5</q_axis_line_i>\n\r\t<dc_volts>0</dc_volts>\n\r\t<dc_volts2>0</dc_volts2>\n\r\t<dc_current>-0.7</dc_current>\n\r\t<ac_current>1.0</ac_current>\n\r\t<common_mode_volts>-5.4</common_mode_volts>\n\r\t19.3\n\r\t<temp_coolant>48.2</temp_coolant>\n\r\t<temp_reactor>96.7</temp_reactor>\n\r\t<temp_cabinet>3.9</temp_cabinet>\n\r\t<ground_i>0.70</ground_i>\n\r\t0\n\r\t<neg_seq_v_mag>0.0</neg_seq_v_mag>\n\r\t<reactive_pwr>-0.0</reactive_pwr>\n\r\t<pwr_ac_limit>0</pwr_ac_limit>\n\r\t<powerfactor_sp>1.000</powerfactor_sp>\n\r\t<temp_ambient_pvm>28</temp_ambient_pvm>\n\r\t<total_kwh>0</total_kwh>\n\r\t<ac_volts>-0</ac_volts>\n\r\t<ac_volts_b>0</ac_volts_b>\n\r\t<ac_volts_c>0</ac_volts_c>\n\r\t<power_dc>0</power_dc>\n\r\n\r\n\r\n\r"}

request.params['data']

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <datacom xmlns="http://www.pvpowered.com"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.pvpowered.com file:./datacom.xsd">
    <inverter>
      <inverter_model>3159500</inverter_model>
      <inverter_serial>551122</inverter_serial>
      <text_serial>551122</text_serial>
      <nx_mb_serial>M/N 3159500-0001 AA

(this is the complete xml, truncated just after the "AA"

Full request object dump*

<Sinatra::Request:0x000000046e7130 @env={"CONTENT_LENGTH"=>"2175", "DOCUMENT_ROOT"=>"/home/pvpower/local/apps/file_logger/public", "SCRIPT_NAME"=>"", "PATH_INFO"=>"/gateway", "REQUEST_URI"=>"/gateway", "SERVER_NAME"=>"dcgateway-stg.pvpowered.com", "CONTENT_TYPE"=>"application/x-www-form-urlencoded", "PASSENGER_USE_GLOBAL_QUEUE"=>"true", "PASSENGER_FRIENDLY_ERROR_PAGES"=>"true", "UNION_STATION_SUPPORT"=>"false", "PASSENGER_DEBUGGER"=>"false", "PASSENGER_SHOW_VERSION_IN_HEADER"=>"true", "PASSENGER_ENVIRONMENT"=>"production", "PASSENGER_SPAWN_METHOD"=>"smart-lv2", "PASSENGER_USER"=>"", "PASSENGER_GROUP"=>"", "PASSENGER_APP_TYPE"=>"rack", "PASSENGER_MIN_INSTANCES"=>"1", "PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME"=>"-1", "PASSENGER_APP_SPAWNER_IDLE_TIME"=>"-1", "SCGI"=>"1", "QUERY_STRING"=>"", "REQUEST_METHOD"=>"POST", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"nginx/1.0.6", "REMOTE_ADDR"=>"67.210.196.5", "REMOTE_PORT"=>"4440", "SERVER_ADDR"=>"50.57.121.9", "SERVER_PORT"=>"443", "HTTP_X_FORWARDED_FOR"=>"", "HTTP_USER_AGENT"=>"User-Agent: Advanced Energy - Woody (10.0.23)", "HTTP_HOST"=>"dcgateway-stg.pvpowered.com", "HTTP_ACCEPT"=>"/", "HTTP_EXPECT"=>"100-continue", ""=>"", "PASSENGER_CONNECT_PASSWORD"=>"XXXXXX", "rack.version"=>[1, 0], "rack.input"=>#<PhusionPassenger::Utils::RewindableInput:0x000000046a85c0 @io=#<PhusionPassenger::Utils::UnseekableSocket:0x00000003d13640 @socket=#<UNIXSocket:fd 10>>, @rewindable_io=#File:/tmp/RackRewindableInput20130418-31478-vopweh, @unlinked=true>, "rack.errors"=>#IO:, "rack.multithread"=>false, "rack.multiprocess"=>true, "rack.run_once"=>false, "rack.url_scheme"=>"http", "rack.request.form_input"=>#<PhusionPassenger::Utils::RewindableInput:0x000000046a85c0 @io=#<PhusionPassenger::Utils::UnseekableSocket:0x00000003d13640 @socket=#<UNIXSocket:fd 10>>, @rewindable_io=#File:/tmp/RackRewindableInput20130418-31478-vopweh, @unlinked=true>, "rack.request.form_hash"=>{"username"=>"XXXXXX", "password"=>"XXXXXX", "data"=>"\n\r\n\r<datacom xmlns="http://www.pvpowered.com\"\n\r\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\r\txsi:schemaLocation=\"http://www.pvpowered.com file:./datacom.xsd">\n\r\n\r\t<inverter_model>3159500</inverter_model>\n\r\t<inverter_serial>551122</inverter_serial>\n\r\t<text_serial>551122</text_serial>\n\r\t<nx_mb_serial>M/N 3159500-0001 AA", "S/N 551122"=>nil, "F/R AA</nx_mb_serial>\n\r\t<firmware_version>10.0</firmware_version>\n\r\t<micro_rev>23</micro_rev>\n\r\t<pvm_status>00</pvm_status>\n\r\t<modbus_addr>175</modbus_addr>\n\r\t7/8/08\n\r\t7200128B.12 \n\r\t7450015J.02 \n\r\t0xf27c\n\r\t1\n\r\t0\n\r\t<pvm_hardware>AEI PVM2025 i.MX28</pvm_hardware>\n\r\n\r<message timestamp"=>""0" poll_count="1" poll_interval="60" type="event" digi_system_clock="1366300694" mmc_free_space="3632427008">\n\r<event sequence_id="0">\n\r\t<timestamp_on>2013-04-18 15:58:10</timestamp_on>\n\r\t<ts_valid>1</ts_valid>\n\r\t<event_type>9</event_type>\n\r\t1538\n\r\t\n\r\t\t553680896\n\r\t\t0\n\r\t\t3584\n\r\t\t0\n\r\t\n\r\t<ac_power>-0.0</ac_power>\n\r\t55.08\n\r\t<ac_kVAr>-0.0</ac_kVAr>\n\r\t<d_axis_line_v>0</d_axis_line_v>\n\r\t<d_axis_line_i>-0.5</d_axis_line_i>\n\r\t<q_axis_line_i>0.5</q_axis_line_i>\n\r\t<dc_volts>0</dc_volts>\n\r\t<dc_volts2>0</dc_volts2>\n\r\t<dc_current>-0.7</dc_current>\n\r\t<ac_current>1.0</ac_current>\n\r\t<common_mode_volts>-5.4</common_mode_volts>\n\r\t19.3\n\r\t<temp_coolant>48.2</temp_coolant>\n\r\t<temp_reactor>96.7</temp_reactor>\n\r\t<temp_cabinet>3.9</temp_cabinet>\n\r\t<ground_i>0.70</ground_i>\n\r\t0\n\r\t<neg_seq_v_mag>0.0</neg_seq_v_mag>\n\r\t<reactive_pwr>-0.0</reactive_pwr>\n\r\t<pwr_ac_limit>0</pwr_ac_limit>\n\r\t<powerfactor_sp>1.000</powerfactor_sp>\n\r\t<temp_ambient_pvm>28</temp_ambient_pvm>\n\r\t<total_kwh>0</total_kwh>\n\r\t<ac_volts>-0</ac_volts>\n\r\t<ac_volts_b>0</ac_volts_b>\n\r\t<ac_volts_c>0</ac_volts_c>\n\r\t<power_dc>0</power_dc>\n\r\n\r\n\r\n\r"}, "rack.request.form_vars"=>"username=XXXXXX&password=XXXXXX&data=\n\r\n\r<datacom xmlns="http://www.pvpowered.com\"\n\r\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\r\txsi:schemaLocation=\"http://www.pvpowered.com file:./datacom.xsd">\n\r\n\r\t<inverter_model>3159500</inverter_model>\n\r\t<inverter_serial>551122</inverter_serial>\n\r\t<text_serial>551122</text_serial>\n\r\t<nx_mb_serial>M/N 3159500-0001 AA; S/N 551122; F/R AA</nx_mb_serial>\n\r\t<firmware_version>10.0</firmware_version>\n\r\t<micro_rev>23</micro_rev>\n\r\t<pvm_status>00</pvm_status>\n\r\t<modbus_addr>175</modbus_addr>\n\r\t7/8/08\n\r\t7200128B.12 \n\r\t7450015J.02 \n\r\t0xf27c\n\r\t1\n\r\t0\n\r\t<pvm_hardware>AEI PVM2025 i.MX28</pvm_hardware>\n\r\n\r<message timestamp="0" poll_count="1" poll_interval="60" type="event" digi_system_clock="1366300694" mmc_free_space="3632427008">\n\r<event sequence_id="0">\n\r\t<timestamp_on>2013-04-18 15:58:10</timestamp_on>\n\r\t<ts_valid>1</ts_valid>\n\r\t<event_type>9</event_type>\n\r\t1538\n\r\t\n\r\t\t553680896\n\r\t\t0\n\r\t\t3584\n\r\t\t0\n\r\t\n\r\t<ac_power>-0.0</ac_power>\n\r\t55.08\n\r\t<ac_kVAr>-0.0</ac_kVAr>\n\r\t<d_axis_line_v>0</d_axis_line_v>\n\r\t<d_axis_line_i>-0.5</d_axis_line_i>\n\r\t<q_axis_line_i>0.5</q_axis_line_i>\n\r\t<dc_volts>0</dc_volts>\n\r\t<dc_volts2>0</dc_volts2>\n\r\t<dc_current>-0.7</dc_current>\n\r\t<ac_current>1.0</ac_current>\n\r\t<common_mode_volts>-5.4</common_mode_volts>\n\r\t19.3\n\r\t<temp_coolant>48.2</temp_coolant>\n\r\t<temp_reactor>96.7</temp_reactor>\n\r\t<temp_cabinet>3.9</temp_cabinet>\n\r\t<ground_i>0.70</ground_i>\n\r\t0\n\r\t<neg_seq_v_mag>0.0</neg_seq_v_mag>\n\r\t<reactive_pwr>-0.0</reactive_pwr>\n\r\t<pwr_ac_limit>0</pwr_ac_limit>\n\r\t<powerfactor_sp>1.000</powerfactor_sp>\n\r\t<temp_ambient_pvm>28</temp_ambient_pvm>\n\r\t<total_kwh>0</total_kwh>\n\r\t<ac_volts>-0</ac_volts>\n\r\t<ac_volts_b>0</ac_volts_b>\n\r\t<ac_volts_c>0</ac_volts_c>\n\r\t<power_dc>0</power_dc>\n\r\n\r\n\r\n\r", "rack.session"=>#<Rack::Session::Abstract::SessionHash:0x2373910 not yet loaded>, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"7814e076b034105c65861824471a4efe44e55918f1028e106ce282086cbeb345", :coder=>#Rack::Session::Cookie::Base64::Marshal:0x00000003bb7530}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}}, @params={"username"=>"XXXXXX", "password"=>"XXXXXX", "data"=>"\n\r\n\r<datacom xmlns="http://www.pvpowered.com\"\n\r\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\r\txsi:schemaLocation=\"http://www.pvpowered.com file:./datacom.xsd">\n\r\n\r\t<inverter_model>3159500</inverter_model>\n\r\t<inverter_serial>551122</inverter_serial>\n\r\t<text_serial>551122</text_serial>\n\r\t<nx_mb_serial>M/N 3159500-0001 AA", "S/N 551122"=>nil, "F/R AA</nx_mb_serial>\n\r\t<firmware_version>10.0</firmware_version>\n\r\t<micro_rev>23</micro_rev>\n\r\t<pvm_status>00</pvm_status>\n\r\t<modbus_addr>175</modbus_addr>\n\r\t7/8/08\n\r\t7200128B.12 \n\r\t7450015J.02 \n\r\t0xf27c\n\r\t1\n\r\t0\n\r\t<pvm_hardware>AEI PVM2025 i.MX28</pvm_hardware>\n\r\n\r<message timestamp"=>""0" poll_count="1" poll_interval="60" type="event" digi_system_clock="1366300694" mmc_free_space="3632427008">\n\r<event sequence_id="0">\n\r\t<timestamp_on>2013-04-18 15:58:10</timestamp_on>\n\r\t<ts_valid>1</ts_valid>\n\r\t<event_type>9</event_type>\n\r\t1538\n\r\t\n\r\t\t553680896\n\r\t\t0\n\r\t\t3584\n\r\t\t0\n\r\t\n\r\t<ac_power>-0.0</ac_power>\n\r\t55.08\n\r\t<ac_kVAr>-0.0</ac_kVAr>\n\r\t<d_axis_line_v>0</d_axis_line_v>\n\r\t<d_axis_line_i>-0.5</d_axis_line_i>\n\r\t<q_axis_line_i>0.5</q_axis_line_i>\n\r\t<dc_volts>0</dc_volts>\n\r\t<dc_volts2>0</dc_volts2>\n\r\t<dc_current>-0.7</dc_current>\n\r\t<ac_current>1.0</ac_current>\n\r\t<common_mode_volts>-5.4</common_mode_volts>\n\r\t19.3\n\r\t<temp_coolant>48.2</temp_coolant>\n\r\t<temp_reactor>96.7</temp_reactor>\n\r\t<temp_cabinet>3.9</temp_cabinet>\n\r\t<ground_i>0.70</ground_i>\n\r\t0\n\r\t<neg_seq_v_mag>0.0</neg_seq_v_mag>\n\r\t<reactive_pwr>-0.0</reactive_pwr>\n\r\t<pwr_ac_limit>0</pwr_ac_limit>\n\r\t<powerfactor_sp>1.000</powerfactor_sp>\n\r\t<temp_ambient_pvm>28</temp_ambient_pvm>\n\r\t<total_kwh>0</total_kwh>\n\r\t<ac_volts>-0</ac_volts>\n\r\t<ac_volts_b>0</ac_volts_b>\n\r\t<ac_volts_c>0</ac_volts_c>\n\r\t<power_dc>0</power_dc>\n\r\n\r\n\r\n\r"}, @route="/gateway">

Project Gemfile.lock

GEM
  remote: http://rubygems.org/
  specs:
    activesupport (3.0.9)
    awesome_print (0.3.2)
    builder (3.0.0)
    capistrano (2.6.0)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    daemon_controller (0.2.6)
    diff-lcs (1.1.3)
    eycap (0.5.18)
      capistrano (>= 2.2.0)
      hoe (>= 1.5.1)
    fastthread (1.0.7)
    haml (3.1.4)
    highline (1.6.2)
    hoe (2.10.0)
      rake (~> 0.8)
    hoptoad_notifier (2.4.11)
      activesupport
      builder
    mime-types (1.17.2)
    net-scp (1.0.4)
      net-ssh (>= 1.99.1)
    net-sftp (2.0.5)
      net-ssh (>= 2.0.9)
    net-ssh (2.1.4)
    net-ssh-gateway (1.1.0)
      net-ssh (>= 1.99.1)
    nokogiri (1.4.4)
    passenger (3.0.7)
      daemon_controller (>= 0.2.5)
      fastthread (>= 1.0.1)
      rack
      rake (>= 0.8.1)
    rack (1.4.1)
    rack-test (0.6.1)
      rack (>= 1.0)
    rake (0.8.7)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    rspec (2.9.0)
      rspec-core (~> 2.9.0)
      rspec-expectations (~> 2.9.0)
      rspec-mocks (~> 2.9.0)
    rspec-core (2.9.0)
    rspec-expectations (2.9.1)
      diff-lcs (~> 1.1.3)
    rspec-mocks (2.9.0)
    shotgun (0.9)
      rack (>= 1.0)
    sinatra (1.2.6)
      rack (~> 1.1)
      tilt (>= 1.2.2, < 2.0)
    tilt (1.3)
    toadhopper (1.2)

PLATFORMS
  ruby

DEPENDENCIES
  awesome_print
  capistrano
  eycap
  haml
  hoptoad_notifier
  nokogiri
  passenger
  rack-test
  rest-client
  rspec
  shotgun
  sinatra
  toadhopper
Owner

raggi commented Jul 12, 2014

This appears to be a bug in Rack::Request#params. It should be passing '&' as a second argument to Rack::Utils#parse_query. Will review for 1.5.3, but may not be able to patch until 1.6.

@raggi raggi added this to the Rack 1.5.3 milestone Jul 12, 2014

@raggi raggi closed this in 71c6911 Jul 13, 2014

Nyoho added a commit to Nyoho/rack that referenced this issue Jan 7, 2015

Fix semicolons as separators for GET
Fix to use semicolons as separators for GET not for POST
A semicolon ';' should be used as a separator according to a W3.org recommendation
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2

The following commit was for only POST not for GET, but the test is
written for GET, which is kind of a discrepancy.
Do not truncate POST data on `;`, closes #543
rack@71c6911
Contributor

Nyoho commented Jan 7, 2015

This commit 71c6911 changes the behavior to separators of GET, too, and the test spec_request.rb of this commit written not for POST but for only GET.

Besides, W3 recommends a semicolon and an should be used as a separator
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
(And in fact this commit influences some projects to go wrong.)

So, should semicolons be used as separators at least in GET?

I wrote a patch here #781.

dbussink added a commit to github/rack that referenced this issue May 22, 2015

Fix semicolons as separators for GET
Fix to use semicolons as separators for GET not for POST
A semicolon ';' should be used as a separator according to a W3.org recommendation
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2

The following commit was for only POST not for GET, but the test is
written for GET, which is kind of a discrepancy.
Do not truncate POST data on `;`, closes #543
rack@71c6911
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment