Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
a2cd89a7
Commit
a2cd89a7
authored
May 23, 2013
by
Julian Aubourg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handles HEAD requests as if they always were 204. Fixes #13922.
parent
eabb56c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
ajax.js
src/ajax.js
+1
-1
ajax.js
test/unit/ajax.js
+23
-0
No files found.
src/ajax.js
View file @
a2cd89a7
...
...
@@ -614,7 +614,7 @@ jQuery.extend({
}
// if no content
if
(
status
===
204
)
{
if
(
status
===
204
||
s
.
type
===
"HEAD"
)
{
statusText
=
"nocontent"
;
// if not modified
...
...
test/unit/ajax.js
View file @
a2cd89a7
...
...
@@ -1499,6 +1499,29 @@ module( "ajax", {
}
});
ajaxTest
(
"#13922 - jQuery.ajax() - converter is bypassed for HEAD requests"
,
3
,
{
url
:
"data/json.php"
,
method
:
"HEAD"
,
data
:
{
header
:
"yes"
},
converters
:
{
"text json"
:
function
()
{
throw
"converter was called"
;
}
},
success
:
function
(
data
,
status
)
{
ok
(
true
,
"success"
);
strictEqual
(
status
,
"nocontent"
,
"data is undefined"
);
strictEqual
(
data
,
undefined
,
"data is undefined"
);
},
error
:
function
(
_
,
status
,
error
)
{
ok
(
false
,
"error"
);
strictEqual
(
status
,
"parsererror"
,
"Parser Error"
);
strictEqual
(
error
,
"converter was called"
,
"Converter was called"
);
}
}
);
//----------- jQuery.ajaxPrefilter()
ajaxTest
(
"jQuery.ajaxPrefilter() - abort"
,
1
,
{
...
...
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