Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5d076961
Kaydet (Commit)
5d076961
authored
Şub 17, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
üst
bcd548bd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
8 deletions
+21
-8
libbasehttp.tex
Doc/lib/libbasehttp.tex
+8
-3
libsimplehttp.tex
Doc/lib/libsimplehttp.tex
+6
-1
BaseHTTPServer.py
Lib/BaseHTTPServer.py
+4
-3
SimpleHTTPServer.py
Lib/SimpleHTTPServer.py
+3
-1
No files found.
Doc/lib/libbasehttp.tex
Dosyayı görüntüle @
5d076961
...
...
@@ -217,11 +217,16 @@ Returns the server software's version string. This is a combination
of the
\member
{
server
_
version
}
and
\member
{
sys
_
version
}
class variables.
\end{methoddesc}
\begin{methoddesc}
{
date
_
time
_
string
}{}
Returns the current date and time, formatted for a message header.
\begin{methoddesc}
{
date
_
time
_
string
}{
\optional
{
timestamp
}}
Returns the date and time given by
\var
{
timestamp
}
(which must be in the
format returned by
\function
{
time.time()
}
), formatted for a message header.
If
\var
{
timestamp
}
is omitted, it uses the current date and time.
The result looks like
\code
{
'Sun, 06 Nov 1994 08:49:37 GMT'
}
.
\versionadded
[The \var{timestamp} parameter]
{
2.5
}
\end{methoddesc}
\begin{methoddesc}
{
log
_
dat
a
_
time
_
string
}{}
\begin{methoddesc}
{
log
_
dat
e
_
time
_
string
}{}
Returns the current date and time, formatted for logging.
\end{methoddesc}
...
...
Doc/lib/libsimplehttp.tex
Dosyayı görüntüle @
5d076961
...
...
@@ -65,13 +65,18 @@ error. Otherwise, the content type is guessed by calling the
\var
{
extensions
_
map
}
variable.
A
\code
{
'Content-type:'
}
header with the guessed content type is
output, followed by a blank line signifying the end of the headers,
output, followed by a
\code
{
'Content-Length:'
}
header with the file's
size and a
\code
{
'Last-Modified:'
}
header with the file's modification
time.
Then follows a blank line signifying the end of the headers,
and then the contents of the file are output. If the file's MIME type
starts with
\code
{
text/
}
the file is opened in text mode; otherwise
binary mode is used.
For example usage, see the implementation of the
\function
{
test()
}
function.
\versionadded
[The \code{'Last-Modified'} header]
{
2.5
}
\end{methoddesc}
...
...
Lib/BaseHTTPServer.py
Dosyayı görüntüle @
5d076961
...
...
@@ -436,10 +436,11 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
"""Return the server software version string."""
return
self
.
server_version
+
' '
+
self
.
sys_version
def
date_time_string
(
self
):
def
date_time_string
(
self
,
timestamp
=
None
):
"""Return the current date and time formatted for a message header."""
now
=
time
.
time
()
year
,
month
,
day
,
hh
,
mm
,
ss
,
wd
,
y
,
z
=
time
.
gmtime
(
now
)
if
timestamp
is
None
:
timestamp
=
time
.
time
()
year
,
month
,
day
,
hh
,
mm
,
ss
,
wd
,
y
,
z
=
time
.
gmtime
(
timestamp
)
s
=
"
%
s,
%02
d
%3
s
%4
d
%02
d:
%02
d:
%02
d GMT"
%
(
self
.
weekdayname
[
wd
],
day
,
self
.
monthname
[
month
],
year
,
...
...
Lib/SimpleHTTPServer.py
Dosyayı görüntüle @
5d076961
...
...
@@ -85,7 +85,9 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return
None
self
.
send_response
(
200
)
self
.
send_header
(
"Content-type"
,
ctype
)
self
.
send_header
(
"Content-Length"
,
str
(
os
.
fstat
(
f
.
fileno
())[
6
]))
fs
=
os
.
fstat
(
f
.
fileno
())
self
.
send_header
(
"Content-Length"
,
str
(
fs
[
6
]))
self
.
send_header
(
"Last-Modified"
,
self
.
date_time_string
(
fs
.
st_mtime
))
self
.
end_headers
()
return
f
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment