You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/10/09 14:18:58 UTC

[Bug 55641] New: "( the )" causes page to be served as text/plain not text/html

https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

            Bug ID: 55641
           Summary: "( the )" causes page to be served as text/plain not
                    text/html
           Product: Apache httpd-2
           Version: 2.2.22
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_include
          Assignee: bugs@httpd.apache.org
          Reporter: apachebugs@insaner.com

In trying to do some SSI stuff I added a line to my parsed file that suddenly
caused html tags to show up. I narrowed it down to this minimal test case (just
the following, single line in the file to be parsed):

<b></b>( the )

You will notice that the tags show up (I'm on Apache/2.2.22 (Fedora), by the
way). However, if you do:

<b></b>(the )

or 

<b></b>( the)

or 

<b></b>( xthe )

or 

<b></b>( thex )

(etc..) the file is served properly.

Other combinations that trigger this bug include anything else in the brackets
as long as the "the" is surrounded by space:

<b></b> (tested on Apache/2.2.22 (Fedora) to give the results below)

which was the original triggering text.

strange, huh?


-- 
-insaner
http://www.insaner.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #14 from insaner <ap...@insaner.com> ---

> If you add the following line to your .htaccess file,
> all of your examples will be treated as HTML:
> 
> AddType text/html .parsed


ahh, thats good to know.. thanks for that

Jeff, is that what you meant in your comment?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #8 from Mike Rumph <mi...@oracle.com> ---
Hello insaner,

I am now able to reproduce the problem.

I had to uncomment the following line in conf/httpd.conf:

MimeMagicFile conf/magic

I now see the same results you are seeing.

I will now try to figure out why this is happening.

Take care,

Mike Rumph

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #4 from insaner <ap...@insaner.com> ---
Created attachment 30966
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30966&action=edit
several parsed files which are served differently

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #3 from Mike Rumph <mi...@oracle.com> ---
Hello insaner,

I have been trying to duplicate this without success.
What SSI directives are you using?

Thanks,

Mike Rumph

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

Mike Rumph <mi...@oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
          Component|mod_include                 |mod_mime_magic
         Resolution|---                         |INVALID

--- Comment #16 from Mike Rumph <mi...@oracle.com> ---
Hello insaner,

Since the problem has been identified and the code appears to be working as
designed and an alternate approach has been recommended, I've set the status to
resolved without code change.

Please, feel free to reopen.

Thanks,

Mike Rumph

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #12 from Jeff Trawick <tr...@apache.org> ---
You can configure a mime type for static resources to avoid mod_mime_magic
having to guess from the content (which is expensive and may be surprising).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Eric Covener <co...@gmail.com> ---
are you using mod_mime_magic? What's the content-type if you serve the include
file directly, and what is its filename?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #6 from Mike Rumph <mi...@oracle.com> ---
Okay, the material is a different setup then what I was trying.

Using your samples I was able to view the webpage.
But the first two iframes display identically for me.
Only the .shtml and .ssi appear as plain text.

I was using a Directory block in conf/httpd.conf instead of a .htaccess file,
but the results should have been the same.

There must be something else that is different in your configuration.

There might be something strange in your conf/magic file.

I will need to do some research to see what else might cause the difference you
are seeing.

Take care,

Mike Rumph

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #15 from Jeff Trawick <tr...@apache.org> ---
>Jeff, is that what you meant in your comment?
yes

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #11 from insaner <ap...@insaner.com> ---
hmm.. strange.. so the solution is to "disable mod_mime_magic"? as in, this
isnt a "bug" its a "feature"?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

insaner <ap...@insaner.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #9 from insaner <ap...@insaner.com> ---
excellent, thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #5 from insaner <ap...@insaner.com> ---
(In reply to Mike Rumph from comment #3)

> I have been trying to duplicate this without success.
> What SSI directives are you using?

hi Mike, thanks for looking into this, I have attached a zip file that you can
extract and view the "thebug_all.html"

when the bug is triggered, you will notice that the first two iframes (the
.parse files) show up differently, the first being served as plain text (so you
can see that html tags) and the second is fine (no html tags seen, due to the
word "the" not being surrounded by spaces on both sides)

I tried this on another server (debian 7.1, I am running fedora 14 here) and I
too was unable to trigger the bug there.. though both servers have the same
.htaccess files at the root and relative levels. I don't know if I will be able
to check the apache config files to compare them, but I will try and see what I
can do. Both are running apache 2.2.22. 

let me know if this is enough info for you to trigger it on your side, or what
other info you need (and how I can obtain it)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #7 from insaner <ap...@insaner.com> ---
hi Mike, I just got the output of apachectl -M for the remote server I
mentioned, and it does not have the 
 mime_magic_module (shared)
loaded (among other differences), whereas my local one (where the bug appears)
does. Hopefully that helps.. how would I go about checking what is wrong with
my mime magic file or the module itself? What would break if I disable the
module to test locally?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #13 from Mike Rumph <mi...@oracle.com> ---
Here is one more point that I forgot to mention.

If you add the following line to your .htaccess file,
all of your examples will be treated as HTML:

AddType text/html .parsed

Thanks,

Mike Rumph

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #10 from Mike Rumph <mi...@oracle.com> ---
Okay, I did a little research.

Believe it or not, the behavior you are seeing appears to be working as
intended.

See line 326 in modules/metadata/mod_mime_magic.c:

-
http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/metadata/mod_mime_magic.c?view=markup 

322     {
323         "The", L_ENG
324     },
325     {
326         "the", L_ENG
327     },

When "The" or "the" appear as tokens in a file, that file is considered English
text and is marked as type "text/plain".
Your other samples "<b></b>(the )" or "<b></b>( the)" keep "the" from being
recognized as a token.

So "<b></b>( the )" is considered English text.

Even more interesting are the following cases:

English:
<h1></h1>( the )

HTML:
<h1> </h1>( the )

English:
<b> </b>( the )

The httpd trunk version of mod_mime_magic.c appears to have the same code.

Thanks,

Mike Rumph

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55641] "( the )" causes page to be served as text/plain not text/html

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55641

--- Comment #2 from insaner <ap...@insaner.com> ---
Hi Eric,

I made a few copies of the file and renamed its extensions, here are the
results:

thebug.ssi     - text/plain
thebug.insert  - text/plain
thebug.shtml   - text/plain
thebug.html    - text/html

I have it set so that it will parse all files, in case that makes a difference.

# apachectl -t -D DUMP_MODULES|grep mime
Syntax OK
 mime_magic_module (shared)
 mime_module (shared)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org