[GH-ISSUE #373] Unusual behaviour for response headers keys registry #369

Open
opened 2026-03-03 19:17:53 +03:00 by kerem · 17 comments
Owner

Originally created by @fulldiver-ilya on GitHub (Jan 13, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/373

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version: 1.13.1

macOS Version: 10.15.2

Hey! Thanks a lot for an amazing tool, but I have a question...

I'm developing iOS application with Alamofire (most common 3-party network library) and using http-headers from our internal server responses. Alamofire provides case-insensitive keys for all headers (they are all lower-cased).
But there is a problem when I use Proxyman: after getting response that pass through Proxyman I have a case like X-Custom-Header. When I toggle-off proxy I get x-custom-header as I expect

Is any way to change or understand this behaviour?

Originally created by @fulldiver-ilya on GitHub (Jan 13, 2020). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/373 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version: 1.13.1 ### macOS Version: 10.15.2 Hey! Thanks a lot for an amazing tool, but I have a question... I'm developing iOS application with Alamofire (most common 3-party network library) and using http-headers from our internal server responses. Alamofire provides case-insensitive keys for all headers (they are all lower-cased). But there is a problem when I use Proxyman: after getting response that pass through Proxyman I have a case like `X-Custom-Header`. When I toggle-off proxy I get `x-custom-header` as I expect Is any way to change or understand this behaviour?
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 14, 2020):

Thank for the report @fulldiver-ilya. Technically, all Field Headers are case-insensitive (https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), so the behavior of the app from end-users should not changed.

However, you're right that Proxyman implicitly capitalizes it. I will improve this behavior by:

  • Keep the same key from the client or server.

I'm on it and send you hot-fix build in this week 👍

<!-- gh-comment-id:573978999 --> @NghiaTranUIT commented on GitHub (Jan 14, 2020): Thank for the report @fulldiver-ilya. Technically, all Field Headers are case-insensitive (https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), so the behavior of the app from end-users should not changed. However, you're right that Proxyman ~implicitly capitalizes it~. I will improve this behavior by: - Keep the same key from the client or server. I'm on it and send you hot-fix build in this week 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 14, 2020):

Hi there, so far from what I investigated that Proxyman doesn't support HTTP/2 since we're heavily relied on CocoaAsyncSocket, which isn't supported it.

I tested with a testing server:

  • If not enable SSL -> Proxyman is a ordinary Proxy -> The HTTPS connection is upgraded to HTTP/2 -> The header keys are lowercase from the server.
  • If enable SSL -> Proxyman does SSLHandshake by CocoaAsyncSocket, but refuse upgrading HTTP/2 from the server -> Use HTTP/1.1 -> The server returns uppercased header by default.

In the initial thought, It might be easy, but actually it's difficult since I have to find a way to support HTTP/2 in CocoaAsyncSocket.


About your case, I believe that your connection from iOS app is downgrade to HTTP/1.1 and the Header in the response from your server are uppercase => Proxyman sends back to the app => X-Custom-Header

Can we @fulldiver-ilya lowercase in your app again to make sure it works in both HTTP/1.1 and HTTP/2?

<!-- gh-comment-id:574004396 --> @NghiaTranUIT commented on GitHub (Jan 14, 2020): Hi there, so far from what I investigated that Proxyman doesn't support HTTP/2 since we're heavily relied on CocoaAsyncSocket, which isn't supported it. I tested with a testing server: + If not enable SSL -> Proxyman is a ordinary Proxy -> The HTTPS connection is upgraded to HTTP/2 -> The header keys are lowercase from the server. + If enable SSL -> Proxyman does SSLHandshake by CocoaAsyncSocket, but refuse upgrading HTTP/2 from the server -> Use HTTP/1.1 -> The server returns uppercased header by default. In the initial thought, It might be easy, but actually it's difficult since I have to find a way to support HTTP/2 in CocoaAsyncSocket. --------------- About your case, I believe that your connection from iOS app is downgrade to HTTP/1.1 and the Header in the response from your server are uppercase => Proxyman sends back to the app => `X-Custom-Header` Can we @fulldiver-ilya lowercase in your app again to make sure it works in both HTTP/1.1 and HTTP/2?
Author
Owner

@fulldiver-ilya commented on GitHub (Jan 15, 2020):

Sorry for late answer but yes, our server is working over http/2.0 with SSL and Proxyman downgrading answer to http/1.1

Proxyman answer:
Screenshot 2020-01-15 at 17 18 39

Charles answer:
Screenshot 2020-01-15 at 17 16 46

Is it answer to your guess?

<!-- gh-comment-id:574680985 --> @fulldiver-ilya commented on GitHub (Jan 15, 2020): Sorry for late answer but yes, our server is working over http/2.0 with SSL and Proxyman downgrading answer to http/1.1 Proxyman answer: <img width="111" alt="Screenshot 2020-01-15 at 17 18 39" src="https://user-images.githubusercontent.com/59820813/72441159-3e308280-37bb-11ea-9515-0d526b555633.png"> Charles answer: <img width="237" alt="Screenshot 2020-01-15 at 17 16 46" src="https://user-images.githubusercontent.com/59820813/72441161-3e308280-37bb-11ea-8b31-5711b0384111.png"> Is it answer to your guess?
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 16, 2020):

Yup, it's correct as I mention that Proxyman currently doesn't support HTTP/2. I'm looking on it to support HTTP/2 soon.

<!-- gh-comment-id:574985724 --> @NghiaTranUIT commented on GitHub (Jan 16, 2020): Yup, it's correct as I mention that Proxyman currently doesn't support HTTP/2. I'm looking on it to support HTTP/2 soon.
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 17, 2020):

Hey @fulldiver-ilya , the good news that Proxyman 2.0.0 is re-written with Swift NIO (https://github.com/ProxymanApp/Proxyman/issues/500), which is capable of supporting HTTP/2.
Let bump this feature forward 🙌

<!-- gh-comment-id:645113443 --> @NghiaTranUIT commented on GitHub (Jun 17, 2020): Hey @fulldiver-ilya , the good news that Proxyman 2.0.0 is re-written with Swift NIO (https://github.com/ProxymanApp/Proxyman/issues/500), which is capable of supporting HTTP/2. Let bump this feature forward 🙌
Author
Owner

@fulldiver-ilya commented on GitHub (Jun 17, 2020):

Hey @NghiaTranUIT its a great news! Congrats 🎉

<!-- gh-comment-id:645158344 --> @fulldiver-ilya commented on GitHub (Jun 17, 2020): Hey @NghiaTranUIT its a great news! Congrats 🎉
Author
Owner

@nunogoncalves commented on GitHub (Dec 9, 2021):

Hello,

We are seeing the same. an API is returning capitalized headers, and after passing by Proxyman they are lowercased.
Is there any configuration to fix this?

<!-- gh-comment-id:989815128 --> @nunogoncalves commented on GitHub (Dec 9, 2021): Hello, We are seeing the same. an API is returning capitalized headers, and after passing by Proxyman they are lowercased. Is there any configuration to fix this?
Author
Owner

@NghiaTranUIT commented on GitHub (Dec 9, 2021):

Just wondering: Do your request/response use any debugging tools?

In the latest build, Proxyman is using HTTP/1.1, so all Headers are capitalized on the first character, and Proxyman doesn't modify any Header by default.

<!-- gh-comment-id:989816853 --> @NghiaTranUIT commented on GitHub (Dec 9, 2021): Just wondering: Do your request/response use any debugging tools? In the latest build, Proxyman is using HTTP/1.1, so all Headers are capitalized on the first character, and Proxyman doesn't modify any Header by default.
Author
Owner

@nunogoncalves commented on GitHub (Dec 9, 2021):

Ok, I think we got it. If we make the request using curl —http1.1 it shows us Auth-Token. If we set it for —http2.0 it lowercases it. I'm unsure to what the correct behaviour should be. :D

<!-- gh-comment-id:989818563 --> @nunogoncalves commented on GitHub (Dec 9, 2021): Ok, I think we got it. If we make the request using curl —http1.1 it shows us Auth-Token. If we set it for —http2.0 it lowercases it. I'm unsure to what the correct behaviour should be. :D
Author
Owner

@nunogoncalves commented on GitHub (Dec 9, 2021):

So, our app, iOS is seeing the header auth-token without Proxyman in the middle, (which seems to support the idea that it supports http 2.0 (according to docs). If we use Proxyman, it shows Auth-Token. If Proxyman supports HTTP2, shouldn't it be auth-token instead? Maybe I'm missing something here.

<!-- gh-comment-id:989820413 --> @nunogoncalves commented on GitHub (Dec 9, 2021): So, our app, iOS is seeing the header `auth-token` without Proxyman in the middle, (which seems to support the idea that it supports http 2.0 (according to docs). If we use Proxyman, it shows `Auth-Token`. If Proxyman supports HTTP2, shouldn't it be `auth-token` instead? Maybe I'm missing something here.
Author
Owner

@NghiaTranUIT commented on GitHub (Dec 9, 2021):

In HTTP/1.1, it's Auth-Token (capitalized on the first character). In HTTP/2, all header is lowercase.
Proxyman hasn't implemented HTTP/2 yet, so all Header will be Auth-Token

<!-- gh-comment-id:989820756 --> @NghiaTranUIT commented on GitHub (Dec 9, 2021): In HTTP/1.1, it's Auth-Token (capitalized on the first character). In HTTP/2, all header is lowercase. Proxyman hasn't implemented HTTP/2 yet, so all Header will be `Auth-Token`
Author
Owner

@nunogoncalves commented on GitHub (Dec 9, 2021):

Ah! Sorry!

So I'm confused to this messagE:

Hey @fulldiver-ilya , the good news that Proxyman 2.0.0 is re-written with Swift NIO (#500), which is capable of supporting HTTP/2.

So, Swift NIO supports HTTP/2, but Proxyman doesn't, yet.

<!-- gh-comment-id:989821505 --> @nunogoncalves commented on GitHub (Dec 9, 2021): Ah! Sorry! So I'm confused to this messagE: > Hey @fulldiver-ilya , the good news that Proxyman 2.0.0 is re-written with Swift NIO (#500), which is capable of supporting HTTP/2. So, Swift NIO supports HTTP/2, but Proxyman doesn't, yet.
Author
Owner

@NghiaTranUIT commented on GitHub (Dec 9, 2021):

ah, yes, sorry for the misunderstanding. It means, Proxyman, powered by SwiftNIO, can support HTTP/2/ in the future. It's easier than the v1.0, which uses bunch of raw socket 😄

HTT/2 is still in our road map 👍

<!-- gh-comment-id:989822415 --> @NghiaTranUIT commented on GitHub (Dec 9, 2021): ah, yes, sorry for the misunderstanding. It means, Proxyman, powered by SwiftNIO, can support HTTP/2/ in the future. It's easier than the v1.0, which uses bunch of raw socket 😄 HTT/2 is still in our road map 👍
Author
Owner

@nunogoncalves commented on GitHub (Dec 9, 2021):

Thanks for your answers.
BTW, I got to say. This was by far the best open source experience I've ever had! It never crossed my mind that I'd get answers in 3 minutes! :D

Also this is one my favourite apps on my Mac, so awesome work! And thank you for that as well!

<!-- gh-comment-id:989830339 --> @nunogoncalves commented on GitHub (Dec 9, 2021): Thanks for your answers. BTW, I got to say. This was by far the best open source experience I've ever had! It never crossed my mind that I'd get answers in 3 minutes! :D Also this is one my favourite apps on my Mac, so awesome work! And thank you for that as well!
Author
Owner

@NghiaTranUIT commented on GitHub (Dec 9, 2021):

Thanks. Glad to know that you really enjoy the app 😄 ❤️

<!-- gh-comment-id:989835540 --> @NghiaTranUIT commented on GitHub (Dec 9, 2021): Thanks. Glad to know that you really enjoy the app 😄 ❤️
Author
Owner

@stodirascu commented on GitHub (Nov 21, 2022):

+1 for the awesomeness of the app 🎉

And +1 to solve this issue. I've stumbled across it recently and baffled me a bit till I understood what's going on. Is there a way to upvote this to switch to HTTP/2 sooner than later?

<!-- gh-comment-id:1322439860 --> @stodirascu commented on GitHub (Nov 21, 2022): +1 for the awesomeness of the app 🎉 And +1 to solve this issue. I've stumbled across it recently and baffled me a bit till I understood what's going on. Is there a way to upvote this to switch to HTTP/2 sooner than later?
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 22, 2022):

Thanks folks to bump the HTTP/2. I will put it in the high priority queue to implement it 👍

<!-- gh-comment-id:1322901150 --> @NghiaTranUIT commented on GitHub (Nov 22, 2022): Thanks folks to bump the HTTP/2. I will put it in the high priority queue to implement it 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#369
No description provided.