[ 
https://issues.apache.org/jira/browse/WW-5127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17342355#comment-17342355
 ] 

icecanh edited comment on WW-5127 at 5/11/21, 7:12 AM:
-------------------------------------------------------

[~lukaszlenart] 
 Thank you for the reply.
 For some security reasons it is difficult for me to share {{web.xml}} and 
{{struts.xml.}}
 No errors occured when starting the server app.

I want to ask more about HTTP requests.
 Are there any requirements in setting headers for HTTP requests when uploading 
files?
 I am thinking in the direction that when migrating to Struts2.5 there was a 
change that affected the request.

Below is the HTTP request and HTTP response

*HTTP request*

*Request Headers*
 POST /api/uploadFile.action HTTP/1.1
 *enctype:* multipart/form-data
 *md5LocalCheckSum:* 6490fda5a51e5eafmd5LocalCheckSumddf1c4ed9cdd3b74
 *Authorization:* OAuth oauth_callback="oob", 
oauth_consumer_key="consumer_key", oauth_nonce="oauth_nonce", 
oauth_signature="oauth_signature", oauth_signature_method="HMAC-SHA1", 
oauth_timestamp="1620716435", oauth_version="1.0"
 *Connection:* Keep-Alive
 *locale_code:* en
 *Content-Type:* multipart/form-data; 
boundary="024a0954-1852-4056-b1b0-c2e92995aafe"
 *Content-Length:* 70755
 *Host:* 172.XXX.XXX.XXX:8443

*Content-Type:* application/octet-stream
 *Content-Disposition:* form-data; name="uploadFile"; 
filename="[consumer_key]_2021-05-11-16-00_[1728].zip"; 
filename*=utf-8''%5Bconsumer_key%5D_2021-05-11-16-00_%5B1728%5D.zip

---------------------------------------------------------------------------
 *HTTP response*

HTTP/1.1 404
 *Content-Type:* text/html;charset=utf-8
 *Content-Language:* en
 *Content-Length:* 796
 *Date:* Tue, 11 May 2021 07:00:34 GMT

<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not 
Found</title></html>
---------------------------------------------------------------------------
*Setting of Action uploadFile*
<action name="uploadFile" class="abc.xyz.api.action.UploadFileAction">
    <result type="json">
        <param name="ignoreHierarchy">false</param>
    </result>
</action>
---------------------------------------------------------------------------
*Request URL*
https://172.XXX.XXX.XXX:8443/api/uploadFile.action


was (Author: icecanh):
[~lukaszlenart] 
 Thank you for the reply.
 For some security reasons it is difficult for me to share {{web.xml}} and 
{{struts.xml.}}
 No errors occured when starting the server app.

I want to ask more about HTTP requests.
 Are there any requirements in setting headers for HTTP requests when uploading 
files?
 I am thinking in the direction that when migrating to Struts2.5 there was a 
change that affected the request.

Below is the HTTP request and HTTP response

*HTTP request*

*Request Headers*
 POST /api/uploadFile.action HTTP/1.1
 *enctype:* multipart/form-data
 *md5LocalCheckSum:* 6490fda5a51e5eafmd5LocalCheckSumddf1c4ed9cdd3b74
 *Authorization:* OAuth oauth_callback="oob", 
oauth_consumer_key="consumer_key", oauth_nonce="oauth_nonce", 
oauth_signature="oauth_signature", oauth_signature_method="HMAC-SHA1", 
oauth_timestamp="1620716435", oauth_version="1.0"
 *Connection:* Keep-Alive
 *locale_code:* en
 *Content-Type:* multipart/form-data; 
boundary="024a0954-1852-4056-b1b0-c2e92995aafe"
 *Content-Length:* 70755
 *Host:* 172.XXX.XXX.XXX:8443

*Content-Type:* application/octet-stream
 *Content-Disposition:* form-data; name="uploadFile"; 
filename="[consumer_key]_2021-05-11-16-00_[1728].zip"; 
filename*=utf-8''%5Bconsumer_key%5D_2021-05-11-16-00_%5B1728%5D.zip

---------------------------------------------------------------------------
*HTTP response*

HTTP/1.1 404
 *Content-Type:* text/html;charset=utf-8
 *Content-Language:* en
 *Content-Length:* 796
 *Date:* Tue, 11 May 2021 07:00:34 GMT

<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not 
Found</title></html>

> Response 404 when migration to Struts 2.5 in Xamarin
> ----------------------------------------------------
>
>                 Key: WW-5127
>                 URL: https://issues.apache.org/jira/browse/WW-5127
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.5.25, 2.5.26
>         Environment: *Current version*
> org.apache.struts:struts2-core:2.5.26
> org.apache.struts:struts2-jfreechart-plugin:2.5.26
> org.apache.struts:struts2-json-plugin:2.5.26
> org.apache.struts:struts2-junit-plugin:2.5.26
> org.apache.struts:struts2-tiles-plugin:2.5.26
> *Previous version*
> org.apache.struts:struts2-core:2.3.34
> org.apache.struts:struts2-jfreechart-plugin:2.3.34
> org.apache.struts:struts2-json-plugin:2.3.34
> org.apache.struts:struts2-junit-plugin:2.3.34
> org.apache.struts:struts2-tiles-plugin:2.3.34
>            Reporter: icecanh
>            Priority: Major
>
> I am using Struts2 as 1 server API and Xamarin as a Client.
> I have the function of uploading files.
> I used HTTPClient.PostAsync to request the server.
> At version 2.3.34, it completes the upload and response 200.
> But after migration struts from 2.3.34 to 2.5.26, I get a 404 response when 
> sending a request to the server API.
> I think the response 404 is because it cannot map to the action.
> Has there been a change in version 2.5.26 that affects the action mapping?
> This problem also occurs in version 2.5.25.
> Thank you for reading and if possible please help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to