logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache query on having multiple slashes in URL
Author
Manish1996



Joined: 26 Apr 2022
Posts: 1
Location: Kolkata

PostPosted: Wed 27 Apr '22 9:35    Post subject: Apache query on having multiple slashes in URL Reply with quote

We are upgrading Apache HTTPD from version 2.4.46 to version 2.4.52
We are seeing that if the URL has multiple slashes , it is not translating into appropriate URL path and failing

This works
==========
curl -kiu adminuser:adminpass-X GET "https://10.xxx.xx.xx////server////host/volume/"

We see in logs, this get meps to GET /api/cluster/nodes/ (ignored the IP and protocol)

However This Does not:
=======================
curl -kiu adminuser:adminpass -X GET "https://10.xx.xx.xx////server////host////volume/"

We see in logs, this get meps to GET /api/cluster////nodes/ (ignored the IP and protocol)

We see for the second case slashes are merged before and after "server" but not for any part of the path after that (eg volume)

Is there any functionality in Apache httpd - 2.4.52 which causes this ? Do we have a workaround to solve this issue ?
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 312
Location: UK

PostPosted: Wed 27 Apr '22 21:27    Post subject: Reply with quote

I have tried to recreate your use case with a generic configuration of Apache 2.4.53, and cannot reproduce your problem, e.g.

Code:
C:\>curl -ki4 -X GET "http:/localhost////a////b////c"
HTTP/1.1 301 Moved Permanently
Date: Wed, 27 Apr 2022 19:12:41 GMT
Server: Apache/2.4.53 (Win64)
Location: http://localhost/a/b/c/
Content-Length: 231
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost/a/b/c/">here</a>.</p>
</body></html>

Apache logs the request URI with the multiple slashes, but you can see the response redirect to Curl has single slashes.

Next, if I add one or more trailing slashes, I get returned the expected index.html file.

Code:
C:\>curl -ki4 -X GET "http:/localhost////a////b////c////"
HTTP/1.1 200 OK
Date: Wed, 27 Apr 2022 19:15:28 GMT
Server: Apache/2.4.53 (Win64)
Last-Modified: Wed, 27 Apr 2022 15:35:13 GMT
ETag: "39-5dda48e31eaf7"
Accept-Ranges: bytes
Content-Length: 57
Content-Type: text/html

<html><body><h1>This is folder 'c'</h1></body></html>

To me this suggests Apache is collapsing multiple slashes at each URI path junction, as one might expect.

You've not posted any Apache configuration (rewrite logic?), which might be affecting your service response.
Back to top
Jmeb



Joined: 27 Apr 2022
Posts: 1
Location: France

PostPosted: Sat 30 Apr '22 17:54    Post subject: Reply with quote

I had this problem too when I upgraded Apache version (working as proxy) on a legacy application. The backend (php-fpm) was stripped of the multiple slashes.
I solved this with the directive MergeSlashes.
Back to top


Reply to topic   Topic: Apache query on having multiple slashes in URL View previous topic :: View next topic
Post new topic   Forum Index -> Apache