473,805 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple content-types break cgi.py

Hi!

The Nokia Java SDK allows one to define multiple content-types in a
single HTTP header field. I'm not sure if it's standard, but it's
happening from some Java-enabled phones.

This breaks the FieldStorage class in cgi.py by not causing
self.read_urlen coded() to be called at object init. Specifically when
one gets a type value like 'text/plain, application/x-www-form-
urlencoded'.

Hacking one of the lines from:
if ctype == 'application/x-www-form-urlencoded':
self.read_urlen coded()
to
if 'application/x-www-form-urlencoded' in [s.strip() for s in
ctype.split("," )]:
self.read_urlen coded()
makes it work as expected.

The only reference to this "bug" I can find dates back to 1999:
http://tinyurl.com/3ahc3r

Regards
Janto

Mar 4 '07 #1
4 1390
In article <11************ **********@p10g 2000cwp.googleg roups.com>, Janto Dreijer wrote:
The Nokia Java SDK allows one to define multiple content-types in a
single HTTP header field. I'm not sure if it's standard, but it's
happening from some Java-enabled phones.

The only reference to this "bug" I can find dates back to 1999:
http://tinyurl.com/3ahc3r
It's not a bug - sending multiple content-types is just totally broken.
What would such a header even be supposed to mean? It's like saying
"this is an apple orange".
Mar 4 '07 #2
In <sl************ ***********@sno wy.squish.net>, Jon Ribbens wrote:
It's not a bug - sending multiple content-types is just totally broken.
What would such a header even be supposed to mean? It's like saying
"this is an apple orange".
And the correct header for such a beast would be "this is an iOrange" of
course. ;-)

SCNR,
Marc 'BlackJack' Rintsch
Mar 4 '07 #3
On Mar 4, 12:29 pm, Jon Ribbens <jon+use...@une quivocal.co.ukw rote:
In article <1173002603.690 853.250...@p10g 2000cwp.googleg roups.com>, Janto Dreijer wrote:
The Nokia Java SDK allows one to define multiple content-types in a
single HTTP header field. I'm not sure if it's standard, but it's
happening from some Java-enabled phones.
The only reference to this "bug" I can find dates back to 1999:
http://tinyurl.com/3ahc3r

It's not a bug - sending multiple content-types is just totally broken.
What would such a header even be supposed to mean? It's like saying
"this is an apple orange".
Hmmm. Thanks! I suspected as much.

Rough inspection suggests that calling
connection.setR equestProperty( "Content-Type", "applicatio n/x-www-
form-urlencoded");
on the Nokia 6230 would actually cause the value to be *appended* and
not set.

Yuck! It looks like I'm going to have to keep a modified copy of
cgi.py if I want to support the phone. Or hack something on the Java
side.

Janto

Mar 4 '07 #4
In article <11************ *********@s48g2 000cws.googlegr oups.com>, Janto Dreijer wrote:
>It's not a bug - sending multiple content-types is just totally broken.
What would such a header even be supposed to mean? It's like saying
"this is an apple orange".

Hmmm. Thanks! I suspected as much.

Rough inspection suggests that calling
connection.setR equestProperty( "Content-Type", "applicatio n/x-www-
form-urlencoded");
on the Nokia 6230 would actually cause the value to be *appended* and
not set.
If that method is inherited from java.net.URLCon nection, then if the
phone is behaving as you suggest, its Java library is bugged and
behaving contrary to Sun's Java documentation.
Mar 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7702
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official Impact Summary</td> </tr> <tr> <td colspan=2></td>
1
4307
by: grandeandy | last post by:
question: in the code below, and in general, how would I input multiple functions into the code, and get multiple outputs? basically, I want to be able to add say 2 or 3 of the div's to the link so that it shows multiple div's at once. <script language="javascript"> <!-- var state = 'none'; function hide(layer_ref) {
1
1744
by: Andy Britcliffe | last post by:
Hi I'm faced with the situation where I could have a single physical file that could contain multiplie XML documents e.g file.txt contains the following: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE doc SYSTEM "1.0b.dtd"> <doc transmission-date="20050715T154340Z" >
1
3515
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The web.config file is configured as such: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" name="myApplication"/> </authentication>
3
3493
by: Arun | last post by:
Hi, I have simple question to ask. How to write multiple Binary files to the Browser using Asp.Net and Visual C#.net I have seen examples where single binary file is written to browser. -Regards Arun
3
1708
by: Henrik Dahl | last post by:
Hello! From default, the ASPNET user is giving the process identity for the ASP.NET runtime environment of IIS, however it's possible to change the user by modifying the <processModel> element in the machine.config file. Is it possible to have multiple IIS servers running, each with their own user specified for the process identity or to specify the process identity specifically for each of the ASP.NET WebForms applications run by a...
11
2231
by: xenophon | last post by:
I have a web site with forms authentication and a single logon page. I have 4 subdirectories, each that should be protected by a different username/password combination. For testing purposes, the username/password are hardcoded into the code-behind C# code. How can I write my web.config to make this happen? Thanks.
3
2606
by: Michel | last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for the user; the user open my app, do some works and try to open another instance of my app, I whant to show a message to user to inform him that only one instance is permit and then close the second instance after that. I am able to do this when the user run the application on his PC whit this : Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName) ...
4
2016
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys Just a general query regarding using the AccessDataSource within a website which uses a MasterPage. The layout of my content page is as follows... <asp:Content ID="Content1" ContentPlaceHolderID="cphContent" Runat="Server"> <h1><asp:Label runat="server" Text='<%# Eval("StoryTitle") %>" ID="lblHeading" />
3
2120
by: MikeB | last post by:
Hello, I have a content page that is from a Master page which has 2 content panes. How do I add my forms to the content page? Each pane needs a form but you can not have multiple form tags nor can the form tages be outside of the content tags? Does this make since? Below is my source to the pages. Basically I need both content tags to have form tags.
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10107
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3846
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.